-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bad completion in string #832
Comments
Could you share your LSP trace please. Have you this problem with old version of LSP4IJ? |
|
I don't see any double quotes |
Based on the current cursor context, I will return different completion items. If the cursor is not within a string, I will return completion items with double quotes. If the completion was triggered by typing double quotes, I will return versions without quotes. |
Is it a problem with custom PsiFile? I suggest that you compare the 2 LSP traces completion response (the one which is working and the other) |
@CppCXY the problem comes from your PsiFile, right? |
my PSI doesn't provide any functionality for autocompletion. I believe it's solely because I defined PSI that this error occurred. |
To be honest, I don't really want to define PSI, but currently comments, bracket matching, and so on cannot be defined through language server. |
What about using language-configuration.json supported by IntelliJ himself? |
Is there any documentation about it? |
I don't think so. You can try it quickly, you will need just to register textmate by selecting the folder which contains package.json from https://github.com/EmmyLua/VSCode-EmmyLua It should register textmate and language-configuration.json. To do that with code, I don't know, you should ask to JetBrains. |
@CppCXY that's strange, it seems IntelliJ provides a lua support with language-configuration.json out of the box https://github.com/JetBrains/intellij-community/blob/0627fa7b16a28b49f23122226d73e46f2c859ed0/plugins/textmate/lib/bundles/lua/language-configuration.json#L4 |
The definitions it provides are insufficient. We are Emmylua—a set of annotation convention plugins on top of Lua. Many parts of the Neovim community use luacats/Emmylua doc definitions. |
I observed an interesting phenomenon. I think this is an issue that needs addressing because I treated Java as a Lua file directly, and the same bug occurred. |
If you think there is a bug from LSP4IJ, please compare LSP tarces from Intellij and vscode. According your trace #832 (comment), the apply completion doesn't contains quote to insert. |
this is log in vscode:
they are same |
However, I'm not sure how to view the contents received by VS Code. What I have here are the logs recorded by my language server. |
To activate LSP traces in vscode, add in your settings JSON
where XXXX is your language server id. |
I found out that this is not a universal method; my language server itself does not support this approach. However, I already showed the messages sent to VSCode, and they are the same as Intellij's. |
I have tested with your language server without custom PsiFile and it works great. |
see the gif
The text was updated successfully, but these errors were encountered: