TypeFox / monaco-components

Monaco Editor and Language Client Wrapper, plus Monaco Editor React Component
MIT License
42 stars 13 forks source link

Remote LSP server cannot access files #60

Closed jadestrong closed 5 months ago

jadestrong commented 9 months ago
image

Is there a way to solve the problem of remote deployment of pyright-langserver being unable to access source files?

kaisalmen commented 8 months ago

Hi @jadestrong sorry I overlooked this question. Does /workspace exist on your machine? This example assumes it is there.

jadestrong commented 8 months ago

Yes, this directory does not exist. If only the directory exists, it will also prompt that the python.py file does not exist, so for each file opened by the editor, it is necessary to create a file with the same name in the workspace directory?

kaisalmen commented 8 months ago

But the languageclient passes the content of the open file to the LS, right? So if your are only interested in the content of the editor it should not matter. I will come back with a more solid answer after testing it.

jadestrong commented 8 months ago

Yes, if you only open one file, it seems ok, but if you open multiple files and reference each other, it will throw a diagnostic error like this: 6k9bBSZOKR After the corresponding blank file has been created in the /workspace directory , it works fine. QuickTime movie

kaisalmen commented 8 months ago

@jadestrong when the pyright runs in vscode the file-creations on the client side are present on the server side directly as they both use the same file system. With this architecture (separated file system of both client and server) you have to ensure this via language server prototcol https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_willCreateFiles on your own

kaisalmen commented 5 months ago

@jadestrong I will close this issue here as the code moved to https://github.com/TypeFox/monaco-languageclient If you see the need to please open a new issue or discussion there.