Running OH 2.4.0 on a rPi3B
VSC 1.37.1 on Win10
OH Extension: 0.5.1
When I start the OH workspace, the OUTPUT window in VSC shows the following:
[Error - 20:10:31] Server initialization failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Illegal character in path at index 23: file://rpi3ohv2/OpenHAB Config/things/main.things
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
[Error - 20:47:49] Server initialization failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Illegal character in path at index 23: file://rpi3ohv2/OpenHAB Config/things/main.things
Unfortunately, I don’t use .things files so nothing is going to be apparent to me either. Which line is 23? Not that I’m certain that 23 is what the error means by index.
You can try to move chunks of the file to separate .things files to see if you can isolate the error down to a specific Thing and then go from there.
I suppose something here cannon handle paths with spaces. If its just VSCode that complains and not openHAB itself it would seem to be a problem there. In either case I’d first try taking the space out of the path to see if that makes a difference.
The issue seems to have been that when connecting from VScode on Windows to an OH instance on a remote Linux host, the Samba share has to be mapped as network drive.
Maybe we should add some kind of information in the settings dialog for the remot LSP setting,
that informs about this limitation, until we found a better solution or solved this completely.
At times I have seen a VSC error complaining it cannot access a .items file with a Windows filename.
Like most do, I, too, run VSC on Win 10 but OH on openHABian/Linux.
Which files does VSC actually try to access directly on Win (other than the current open one) ?
If it works on more than the currently open file that would require to have the OH .items/.rules dir mounted on some known, specific place in the Windows filesystem hierarchy else VSC cannot know e.g. where to look for a .things file that has a definition that has a channel reference in a .items file.
VSC looks and works with the currently opened files from my knowledge.
I had the impression that the lsp implementation does some own internal lookup work, but i can’t say much about that.
We would have to ask openHAB Core maintainers, since hte lsp parts are maintained there.
We have plenty threads where a share opened on windows shows the linux paths in the language error messages and then can’t be opened.
This must come from the language server code.
On extension side, we are just starting the connection to remote language server currently.