-
Notifications
You must be signed in to change notification settings - Fork 147
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
Inconsistent completion suggestions on JSX attributes #679
Comments
Please provide a repo that reproduces. |
@rchl there you go |
Can't reproduce: Screen.Recording.2023-02-08.at.23.57.09.mov(Using Typescript 4.9.5 from the workspace here) You could enable logging by passing those initialization options and provide a log from the
|
I was able to get some information when setting This is the output when triggering completion on a new line:
This is the output when triggering completion after
I'm unsure what to actually look for here, but it's clear that the latter includes information for properties like It would be really helpful if someone could help give an indication on the root of this problem, so we can open issues at the correct project. |
Can you reproduce on the repo above? It would be better if we are on the same page. Also, please provide logs from the beginning of the server start since it's important to see which settings are passed and what is the workspace folder set to. |
@rchl Sure thing, here you are: This is when triggering completion with cursor left to the
This is when triggering completion with cursor right to the last
Note again that the latter has more completion items than the former. |
Do you have two separate LSP servers running or am I misreading the logs? In the first log I can see that completion request is triggered for If those are different servers then that likely explains some things. Not sure how neovim handles multiple servers situation in regards to completion requests... |
@rchl Indeed. I have two LSP running, one for TypeScript and one for diagnostics etc. I'll turn |
So, this is the logs without This is when triggering completion with cursor left to the
This is when triggering completion with cursor right to the last
Note again that the latter has more completion items than the former. |
I do see different completions in those two cases but I'm still unsure what is expected and what not. Here While here it isn't: But that seems like expected behavior because if But if that's the original problem then I think it's not specific to this server but to |
Also important to mention that your issue @sQVe might be different from the initial one. The initial one was about It's a snippet completion though and I can see that responses in your logs don't have those. That would mean that either neovim doesn't support snippet completions or doesn't announce support for those (the |
@rchl I did not look for |
I've already pointed out what is likely the issue here:
|
Ensure that capabilities is set for all LSP servers, which in turn provides the correct completions. Closes: jose-elias-alvarez/typescript.nvim#61 Ref: typescript-language-server/typescript-language-server#679
@rchl I'm very grateful that you took your time and helped me debug this. I solved this by properly setting Thank you once again 🙏🏼 |
I'm assuming it's the same for @brun8. It looks like it from the screenshots. |
@rchl Yes. I would assume it is, especially after looking through his/hers dotfiles. It's very likely a |
yes it was, thanks for the help! |
If the client doesn't advertise support for snippet completions, shouldn't you turn those into regular ones? I.e. even though |
I don't think that this server should be doing that. You could request such feature in |
Okay, but what do I say in that feature request? I'm not familiar with how this server uses the typescript lib. Does it query the compiler via some introspection modules? Does the compiler provide the snippets as well? |
The project I'm using is a Solid Start project on the default settings, but I tested it in a Next.js applications an had the same problem. This is using typescript but it behaved the same in a project with javascript.
When i prompt the completion menu inside a jsx tag I don't get the full list of attributes (the "class" and "onClick" attributes for example are not there).
But when I try it with the cursor right next to the quotations i get the full list as intended
Doesn't seem to be an editor problem as I tested it in neovim and helix and had the same results.
The screenshot can't show the whole list but you can see the scroll bar is a lot smaller on the second one.
I'm running tsserver on version 3.1.0
The text was updated successfully, but these errors were encountered: