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
Incorrect highlight on open reference (clangd) #1153
Which version of LSP4IJ are you trying? You should use 0.14.0.
But clangd support LSP semantic highlight, so it should work, but perhaps semantic highlight is not ready when you open the file and you have this trouble. If you open another files have you this problem? Could you check in the LSP console that semantic highlight is called.
@angelozerr Yes, I have predefined in my plugin. But i test without it on a clean environment and I also have this problem. clangd log from the lsp4ij 0.14.1: lsp4ij_0_14_1_clangd.txt
@angelozerr The log above is from IDE without my plugin. In the IDE with my plugin and removing the extension it also doesn't work.
ps When testing in a clean environment, I saw a correctly working transition a couple of times, on some files. But after restarting IDE, everything didn't work again on the same files.
If I understand correctly, you are testing with the user defined ls from LSP4IJ without your plugin and it is working but when you restart IDE it doesn't work? If it that I think it is because semantic tokens is not available and the LSP semantic token provides which manages tokens is not active.
If you have this problem it is because you have not a proper PsiFile expected by IntelliJ.
We did a fix by creating a proper PsiFile by using semantic tokens. But if semantic token is snot available, you will have this problem.
@angelozerr If I use textmate parser in my plugin, I get transitions to work, but problems with double-click selection appear on some files. Apparently, I need to implement my own PsiFile...
But the problem with clean environment without my plugin still exists.
Sorry, I posted clangd log instead trace. Trace is below.
@Ant-ON does this still happen with 0.30.1? #1854 changed which range Ctrl+hover underlines in a file type without a language. If it still happens, an LSP console trace (verbose) of the hover would help.
Activity
angelozerr commentedon Jun 26, 2025
Here the explanation of this behavior #98
Which version of LSP4IJ are you trying? You should use 0.14.0.
But clangd support LSP semantic highlight, so it should work, but perhaps semantic highlight is not ready when you open the file and you have this trouble. If you open another files have you this problem? Could you check in the LSP console that semantic highlight is called.
Ant-ON commentedon Jun 26, 2025
@angelozerr Yes, I use the LSP4IJ 0.14.0.
I opened different files. And there was this problem.
I cleared
clangdlog, pressed Ctrl + Click and seentextDocument/definitioncalls onlyangelozerr commentedon Jun 26, 2025
Could you share your full LSP traces.
angelozerr commentedon Jun 26, 2025
Are you using a custom PsiFile?
angelozerr commentedon Jun 26, 2025
It seems you define custom language https://github.com/Ant-ON/intellij-c-cpp-lsp/tree/main/src/main/kotlin/ru/zdevs/intellij/c/lang but you don't define a custom PsiFile. I think it is the explanation of your issue.
To check that, try to remove *.h from https://github.com/Ant-ON/intellij-c-cpp-lsp/blob/8dedb1dfd349c4f8481691b985aeeb3b2997665b/src/main/resources/META-INF/plugin.xml#L20 and try to open a *.h file, it should work, right?
Ant-ON commentedon Jun 26, 2025
@angelozerr Yes, I have predefined in my plugin. But i test without it on a clean environment and I also have this problem. clangd log from the lsp4ij 0.14.1:
lsp4ij_0_14_1_clangd.txt
angelozerr commentedon Jun 26, 2025
Have you tried to remove your fileType (or just remove a h file extension) and test if it is working.
Ant-ON commentedon Jun 26, 2025
@angelozerr The log above is from IDE without my plugin. In the IDE with my plugin and removing the extension it also doesn't work.
ps When testing in a clean environment, I saw a correctly working transition a couple of times, on some files. But after restarting IDE, everything didn't work again on the same files.
angelozerr commentedon Jun 26, 2025
If I understand correctly, you are testing with the user defined ls from LSP4IJ without your plugin and it is working but when you restart IDE it doesn't work? If it that I think it is because semantic tokens is not available and the LSP semantic token provides which manages tokens is not active.
If you have this problem it is because you have not a proper PsiFile expected by IntelliJ.
We did a fix by creating a proper PsiFile by using semantic tokens. But if semantic token is snot available, you will have this problem.
angelozerr commentedon Jun 26, 2025
Please note that your trace doesn't come from LSP console, see https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserGuide.md#lsp-console
Ant-ON commentedon Jun 26, 2025
@angelozerr If I use textmate parser in my plugin, I get transitions to work, but problems with double-click selection appear on some files. Apparently, I need to implement my own PsiFile...
But the problem with clean environment without my plugin still exists.
Sorry, I posted clangd log instead trace. Trace is below.
lsp4ij_0_14_1_clangd_trace.txt
angelozerr commentedon Jun 26, 2025
If I understand correctly, Ctrl+Click is working but double-click doesn't work? It is an another issue. doucle-click uses selectionRanges
You should see some Trace - 11:07:54] Sending request 'textDocument/selectionRange trace (I don't see those trace in your LSP trace)
angelozerr commentedon Jun 26, 2025
It seems you are using clangd from your user/bin.
Could you please click on Reinstall
to consume the last version of clangd
Ant-ON commentedon Jun 26, 2025
@angelozerr Trice with the downloaded version of clangd:
lsp4ij_0_14_1_clangd_trace_2.txt
angelozerr commentedon Jun 26, 2025
Do you do a double click?
Ant-ON commentedon Jun 26, 2025
@angelozerr
Ctrl+ Clickangelozerr commentedon Jun 26, 2025
and it doesn't work?
Ant-ON commentedon Jun 26, 2025
@angelozerr It's work, but look like in the first post.
Enviroment: vanilla IDE + LSP4IJ 0.14.1 + installed clangd
angelozerr commentedon Jun 26, 2025
Ok so it doesn't work, Ctrl+Click highight the full editor content. In my case it is working ?
Ant-ON commentedon Jun 26, 2025
@angelozerr
Ctrl+ click does not work in the standard implementation of LSP4IJ. But it works with my plugin.lagergren commentedon Nov 20, 2026
@Ant-ON does this still happen with 0.30.1? #1854 changed which range Ctrl+hover underlines in a file type without a language. If it still happens, an LSP console trace (verbose) of the hover would help.