Replies: 1 comment
-
Most language servers are expecting to have access to the same filesystem as vscode. With that lib, the filesystem is virtual, so in order for everything to work properly, you'll need to "synchronize" the client filesystem with the server. It can be done by hands by registering a filesystem overlay that will send a request to your server by any protocol you want every time a file changes. (cons: you need to code and maintain something for it) It can also be handled by the vscode server that is pluggable to that library since the last version, which will make the remote filesystem available on the client (cons: you need to be able to start a server with a websocket on your server) |
Beta Was this translation helpful? Give feedback.
-
I know from some other issues posted, that for some Language Servers, the file:// protocol will be more suitable to handle the files. For Python for example, how can I use local files and have them to work correctly with Monaco?
So I create the editor passing the path ‘C:\py_workspace\main.py’ and inside this path I have a definition.py.
I can import this module, I can use it's contents, but if I go to the Peek -> Definitions or References for members of this module, the selection is empty and I see an error in the console.
The same happens for built ins, event though this file exists, the Editor will throw a similar error, saying that it was unable to read the file.
Is there any way to make this work? I know there is some issues with accessing local files inside a webpage. Is it some sort of permission that I need to grant for the file to correctly load? In this case the Editor will be hosted by a WebView2, running as a native windows app.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions