vuejs / language-tools

âš¡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

docs(nvim): add nvim-cmp integration #4463

Closed RayGuo-ergou closed 3 days ago

RayGuo-ergou commented 2 weeks ago

Hi 👋

This is a documentation update for neovim user, nvim-cmp is a popular neovim plugin used for auto complete code, I know this might be a little bit off topic but I hope this can help some neovim users.

As mentioned in the content, I was inspired by this post.

Basically this changes:

image image

to:

image image

gegoune commented 2 weeks ago

Please note that this will affect all LSP servers which might not be desirable. It could be wrapped in conditional statement based on LSP server name, what do you think?

RayGuo-ergou commented 2 weeks ago

Please note that this will affect all LSP servers which might not be desirable. It could be wrapped in conditional statement based on LSP server name, what do you think?

Thanks for pointing that out! You are absolutely right! Since javascript/typescript does not use : and @ I think check buffer type would be enough.

gegoune commented 2 weeks ago

I think there is entry.source.name, which is what I had in mind of using here. Not sure whether by saying ' javascript/typescript does not use…' you mean script part of Vue file or completely separate files?

Reason I am asking is because I think using filetype check will make it work outside of template section, which is the only ona that this change is relevant to, isn't it? (in which case my entry.source.name check still won't be enough).

Need to be careful here though as it might have wide performance radius blast.

RayGuo-ergou commented 2 weeks ago

think there is entry.source.name, which is what I had in mind of using here.

It will return the name like nvim_lsp or buffer so I dont think it's the right thing to use here.

. Not sure whether by saying ' javascript/typescript does not use…' you mean script part of Vue file or completely separate files?

What I mean is neither JavaScript nor Typescript use @ or : as keyword. e.g. lua has a:b

Need to be careful here though as it might have wide performance radius blast.

I am not worry too much about this to be honestly, as first this will only apply in vue files, second /^:/ or /^:-on/ should be very fast as it just check the start of the string.

johnsoncodehk commented 5 days ago

Hi @RayGuo-ergou, do you want to open a discussion and add the discussion link in the readme instead? This may be easier to manage Q&A.

johnsoncodehk commented 3 days ago

Thank you!