Yes that’s it :-). But it only happens if the LSP really can parse the file. If it can’t get it because of the share definitions (see https://github.com/eclipse/smarthome/issues/6611) the menu options don’t appear (that’s why I was not able to reproduce it in my first tries).
We should disable these function if there is no working implemention. Will try to figure out whether we can do it in the extension or whether the LSP itself must do it.
you are correct.
Even on 0.4.0 these menu options appear
The difference in my 2 screenshots here is that the first one had no settings applied on settings.json
Since the default is: "openhab.lspEnabled": true
the setting that is affecting this is the "openhab.host": "homer" (without this, my local VSC on windows cannot connect to the remote Linux machine running OH2 and to the default LSP port)
I have created an issue for this problem: https://github.com/eclipse/smarthome/issues/6654 . The XTEXT-based LSP server sets nearly all LSP capabilities to “enabled” even if they are not implemented. We probably would have to override the server implementation and set only the currently supported capabilities to “true”.
Does the error only appear or do you have “real problems” in your environment too?
I am really not into that lsp stuff currently and we are refactoring the whole system anyway, so i cant tell you much about it.
If there is just the “duplicate file” error without affecting your system, i would like to leave it for now and see if we can already solve that with the upcoming new implementation.
I have seen this message before but this happened when I had two files with nearly similar file names in the rules folder (xxx.1.rules and xxx.rules).
I also can remember that I saw this message one time in my Windows environment
As far as I can see the message comes directly from the LSP. So I don’t think that it is caused by the extension.
Well, I am not sure if this is related to the duplicate file error message but it is also not possible in rules-files to click on a problem in order to get the line of code with the problem. If I click on a problem then I get the next error message that the file cannot be found (although it is open in this very moment and I clicked on a problem message within that file). And with the next mouse click VSCode closes the open rules-File without warning and I am not able to edit it:
So it is not really possible to detect a problem, click on it and edit the problem code. The file will be closed before you can correct it. That is not really expected system behaviour.
However the other functions have improved significantly and I could live with the workaround to not click on problems in the near future…
Yeah, there are many open topics about code validation, syntax checking and code completion currently.
That’s exactly the reason why we decided to give a completely new implementation a try.
This is a really fresh topic and so its under big changes currently but hopefully this will bring us a stable and expandable solution for the future.
Another workaround would be to simply disable the current code checking with the openhab.lspEnabled setting.
Since you are facing problems anyway, maybe it doesn’t hurt to disable it completely for now.