-
Notifications
You must be signed in to change notification settings - Fork 7
Implementing Vue LSP #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey, happy to help out and take a look. Sounds like you've tried something so far - can you share the branch you're working off of? |
Thank you so much! Here it is: https://github.com/tommasongr/nova-vue/tree/vue-lsp |
The first thing I see is
because the extension's not running a self-install, like mine does. (I use shrinkwrapping, which I'd recommend over a second package-lock.json, since it's intended for publishing like this. There's no effective difference, but I feel it makes it more obvious what's going on) (looks like your language server has a ton of dependencies, which is a bit annoying) After installing, it looks like the language server starts up with no issues. I'd recommend naming it something different than "Vue" to differentiate extension console output between your extension and the language server. (I don't get any functionality off the bat because a It looks like the language server is doing something... this suggestion isn't provided without it.
Note that nova doesn't offer suggestions immediately after typing
I'm not sure what the custom completions are supposed to be doing, but I definitely see new completions coming from the language server. I've only played with nova completions a tiny bit, but I wouldn't be entirely surprised if running a language server conflicted with other custom defined completions from the same extension. |
Thank you so much for your time and feedback! Thanks for the suggestions of using shrinkwrapper, i'll definitely merge your pull request #4
Yes I saw that, what I ment was that on vscode for example the suggestion for These are some completions that I defined specifically for the vue-html subsyntax. The LSP overtooks them and provides these instead Nothing wrong until you confirm and... it escapes and places Also the standard completions for other things like css are gone Maybe @panicinc can take a look on this? |
Hi, I'm a Vetur project contributor. I work in this issue. Maybe you can wait this issue. |
It would be great! Thanks for your contribution! @yoyo930021 |
I see... I think this is something we'll need Panic to solve. The LSP does have support for completion placeholders. It kind of looks like Vetur's language server is generating placeholders, but I'm not positive. That's something to confirm by inspecting the messages it's sending. If it does, my guess is that Panic hasn't yet added support for them from Nova's side. |
From the Nova 1.2 Release Notes:
|
@jonowells I tried yesterday 1.2 updates with the already in place implementation of vls but it still autocomplete with e.g: @apexskier gives it a try too and found the same issue. I reached out some folks at Panic and they are looking at it. Let's see |
Now Nova 2 has been released. Any improvements on this? |
@laosb I started looking at it yesterday evening! The LSP already works. The problem right now is that the LSP overrides the custom defined completions and their completions are not the best to be honest... I'm looking to a way to disable the LSP completion feature but I'm not sure on how VLS works. The working branch is language-server. vls is there just for reference. @yoyo930021 Can you help me on this? |
I can add option for disable LSP completion. |
@yoyo930021 sorry about that I guess I didn't explain myself correctly. Is not about what vls has but what it doesn't have. Take a look... This kind of completions are not available in vls and if an LSP is activated the custom completions are not shown. However I've been able to show them programmatically through the Nova API. I think I'll rewrite them this way |
Another option might be to add the completions to the LSP directly but I'm not sure if is it possible with VLS and eventually how to do that. In that case it would be possible to scope the completions to the export default only? and maybe customize them based on the lang type (js, ts, ...)? |
@laosb Vetur mode has finally landed on Nova! Slap that update button! 🥳 |
Since the LSP is implemented I'll close the issue. Thank you all guys! |
Sorry it's a little late to reply. It also appears that nova doesn't allow you to use both at the same time. |
@yoyo930021 Thanks! I'll take a look at both strategies! Anyway can I ask you why intellisense works flawlessly inside script tag but when it comes to the template it doesn't seem to exist at all? I would love to fix that too, thanks |
I'm not sure what part of intellisense you're referring to in the template.
|
As you can see inside the template directives intellisense is not working. This is the only problem I've found for now, everything else works well. If this is caused by |
This is a option in setting not a command. Vetur can send setting when init. |
I'm trying to implement the Vue Language Server, unfortunately I didn't get that far.
First of all the custom Completions for Vue and the standard Completions for html and css are not shown anymore. Javascript syntax has improved a little bit but not significantly improvements to vue. For example
this
doesn't offer intellisense as it should. I have no clue on how to implement a correct version of this 😕If anyone can help me, I'd really appreciate it 🙏
@apexskier I've seen that you worked on a similar thing for typescript. Would you mind taking a look at it?
The text was updated successfully, but these errors were encountered: