You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to see code completion after the colon in comments. #447
I can reproduce with the emmylua2 plugin, but without it, by simply defining a LS manually pointing to ~/.vscode/extensions/tangzx.emmylua-0.8.17-darwin-arm64/server/EmmyLua.LanguageServer-darwin-arm64/EmmyLua.LanguageServer, completion works properly, with the exact same completion response as @CppCXY
I can reproduce with the emmylua2 plugin, but without it, by simply defining a LS manually pointing to ~/.vscode/extensions/tangzx.emmylua-0.8.17-darwin-arm64/server/EmmyLua.LanguageServer-darwin-arm64/EmmyLua.LanguageServer, completion works properly, with the exact same completion response as @CppCXY
It looks like it is a problem with a custom PsiFile. Perhaps completion is not allowed inside PsiComment?
Could you give me which vscode extension for EmmyLua are you comparing with your EmmyLua2 IJ plugin? It seems that I don't use the same language server than vscode, right?
My plugin does not provide completion after typing :, but it does provide completion when typing the first letter.
Yes I have noticed that, but I do Ctr+Space and it is working in vscode but not in IJ, although vscode and LSP4IJ send the same LSP request completion. It is the reason why I suggest that you debug your language server.
My plugin does not provide completion after typing :, but it does provide completion when typing the first letter.
Yes I have noticed that, but I do Ctr+Space and it is working in vscode but not in IJ, although vscode and LSP4IJ send the same LSP request completion. It is the reason why I suggest that you debug your language server.
Indeed, I use LuaLS on IntelliJ, and the result is correct. It might indeed be necessary to compare the differences. Both plugins are made by me.
I can reproduce with the emmylua2 plugin, but without it, by simply defining a LS manually pointing to ~/.vscode/extensions/tangzx.emmylua-0.8.17-darwin-arm64/server/EmmyLua.LanguageServer-darwin-arm64/EmmyLua.LanguageServer, completion works properly, with the exact same completion response as @CppCXY
@CppCXY after debugging LSP4IJ with your plugin, the problem comes from the completion prefix matcher which is in your case (when plugin is installed)
disable-next-line : u although it should be just u. Without installing your plugin it is working correctly, so I suspect the problem comes from the custom PsiFile which doesn't parser correctly the disable-next-line : u
work well, However, using PSI to fully implement the parsing of the doc section is very difficult. Doing so would require maintaining two different language implementations of the parsing method.
I understand. I don't know if it is possible to customize prefix matcher. If it is possible, I think LSP4IJ should provide an LSP API to customize it and you could use it.
Activity
fbricon commentedon Aug 12, 2024
which LS is that, so we can try to reproduce?
CppCXY commentedon Aug 12, 2024
you can direct install EmmyLua2 in intellij idea

angelozerr commentedon Aug 12, 2024
@CppCXY if you do Ctrl+Space, do you see completion popup?
CppCXY commentedon Aug 12, 2024
no I can't see
fbricon commentedon Aug 12, 2024
I can reproduce with the emmylua2 plugin, but without it, by simply defining a LS manually pointing to ~/.vscode/extensions/tangzx.emmylua-0.8.17-darwin-arm64/server/EmmyLua.LanguageServer-darwin-arm64/EmmyLua.LanguageServer, completion works properly, with the exact same completion response as @CppCXY
fix: Unable to see code completion after the colon in comments.
angelozerr commentedon Aug 12, 2024
It looks like it is a problem with a custom PsiFile. Perhaps completion is not allowed inside PsiComment?
CppCXY commentedon Aug 12, 2024
But the preceding
disablealso has completion.angelozerr commentedon Aug 12, 2024
Indeed, I need to debug IJ to understand more the problem.
angelozerr commentedon Aug 13, 2024
@CppCXY I have installed your plugin, and with LSP4IJ there are empty completion in LSP console:
Given this lua file:
---@diagnostic disable-next-line :angelozerr commentedon Aug 13, 2024
But I have the impression that it is not the same language server (or perhaps not the sameconfig). I have this error
although with vscode, I have no error.
CppCXY commentedon Aug 13, 2024
But they are two different plugins, and on the VS Code side, it should also use EmmyLua.
angelozerr commentedon Aug 13, 2024
Could you give me which vscode extension for EmmyLua are you comparing with your EmmyLua2 IJ plugin? It seems that I don't use the same language server than vscode, right?
9 remaining items
angelozerr commentedon Aug 13, 2024
Yes I have noticed that, but I do Ctr+Space and it is working in vscode but not in IJ, although vscode and LSP4IJ send the same LSP request completion. It is the reason why I suggest that you debug your language server.
CppCXY commentedon Aug 13, 2024
Indeed, I use LuaLS on IntelliJ, and the result is correct. It might indeed be necessary to compare the differences. Both plugins are made by me.
angelozerr commentedon Aug 13, 2024
Same thing for me on Windows OS.
angelozerr commentedon Aug 13, 2024
@CppCXY I can see the LSP completion response now but the completion is not opened, let me investigate the problem.
angelozerr commentedon Aug 13, 2024
@CppCXY after debugging LSP4IJ with your plugin, the problem comes from the completion prefix matcher which is in your case (when plugin is installed)
disable-next-line : ualthough it should be justu. Without installing your plugin it is working correctly, so I suspect the problem comes from the custom PsiFile which doesn't parser correctly thedisable-next-line : uCppCXY commentedon Aug 16, 2024
I have to split it into different tokens to achieve this.

angelozerr commentedon Aug 16, 2024
Is it working now?
CppCXY commentedon Aug 16, 2024
work well, However, using PSI to fully implement the parsing of the doc section is very difficult. Doing so would require maintaining two different language implementations of the parsing method.
angelozerr commentedon Aug 16, 2024
I understand. I don't know if it is possible to customize prefix matcher. If it is possible, I think LSP4IJ should provide an LSP API to customize it and you could use it.
fix: a completion item without a textEdit is matched against the word…
fix: a completion item without a textEdit is matched against the word…
fix: a completion item without a textEdit is matched against the word…