Comments (5)
If we provide the below config, I think this features can be implemented (but it is not a general solution, I think)
let g:compe_path_alias = {
\ '@': { bufnr -> SomeYourProjectRootDetection(bufnr) . '/src' },
\ }
from nvim-compe.
Do you know the some other completion-engine that realized it?
If so, I want to ask you about it.
In my impression, it is difficult in general solution.
from nvim-compe.
There's no completion that does this as far as I'm aware. So this might be impossible to do, even if it's possible then it might be difficult.
Just asking, how do compe-nvim generate path completion? Is it reading the previous word and then gives the autocomplete items? I have an idea to replace the alias to a certain word and then lookup on that directory, but I don't know if this will work or not, just a thought on my head.
If that wouldn't work either, feel free to close this issue. It's not that I really want it but it's a nice thing to have, just curious if it's actually possible or not. Thanks!
from nvim-compe.
Yeah, defining it manually is not a good solution in my opinion but that's doable. I'll try to play around with it to see if I can come up with something. I don't think it is worthy enough to merge it into master though since only a fraction amount of people that uses it, including me.
Closing this issue for now.
from nvim-compe.
I had considered it before.
In my previous thoughts, it is absolute path mode
.
For example, Your suggested example is converting @/components/stu
to %ROOT%/src/components/stu
.
We can think it is an upward search for project structure.
/%ROOT%
/src
/components
/student
index.tsx
/school
index.tsx
/app
index.tsx
In /app/index.tsx
, @/components/stu
is ../components/stu
.
In /components/school/index.tsx
, @/components/stu
is ../../components/stu
.
But this solution makes unexpected behavior if /src/components/components/school/index.tsx
is existing.
Probably, this solution can be a general solution with more careful consideration.
from nvim-compe.
Related Issues (20)
- Breaking undo history after typing certain characters after completion HOT 1
- Can not get LSP Snippet working HOT 1
- relative path completion fail if not stating with './' HOT 1
- [Question] Don't append ? for optional arguments HOT 2
- Add the possibility to hide the completion source. HOT 4
- clangd not hiding suggestions after comma or space HOT 3
- Question/Help: LSP Snippet Support Not Working HOT 1
- [Question] Filter completion items by kind, exclude 'Text' items HOT 1
- Documentation syntax highlighting. HOT 5
- attempt to call field 'stylize_markdown' HOT 2
- Custom labels for completion types HOT 2
- FR/Question: Complete on any key HOT 3
- Documentation doesn't pop in completion in some cases HOT 1
- buffer completion should complete words for hidden buffers. HOT 3
- problem with vim-rsi pluggin -- <C-e> HOT 3
- Auto-import doesnโt work with a bunch of LSPs HOT 1
- Buffer Source Completion: diacritic characters are ignored HOT 2
- Triggered in command mode. HOT 2
- Integrate copilot.vim? HOT 2
- No fuzzy completion for [emoji] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-compe.