Closed arnoson closed 2 years ago
@arnoson In that case you can assign an arbitrary filename.
A language server usually keeps a virtual representation of a workspace within its state. And, in that workspace, your files need names. Even if you are dealing with just a single file, give it any arbitrary and reasonable name.
For example, you can just name the file "main.cpp" in the case of a C++ source file.
Thank you for the explanation @hjr265 !
What I still don't understand however is how the language server can access the file if it is only in memory. I watched the WS communication and it seems that the filename I choose is used as the URI that is send to my language server. The language server can't access this non-existent file und keeps returning "loading workspace 0/0".
Nevermind, I just saw that the file content is send over WS, so my problem seems not related to this.
Not really an issue more a question:
In your example you use a
filename
variable in the language server setup. Can you explain how this works exactly? Right now my file will only exist in codemirror and not in a filesystem. How can I still connect a language server?thanks, Arno