monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

sync files with language server

Open justinmann opened this issue 8 months ago • 2 comments

  • Created a custom FileSystemProvider to capture file changed
  • Send file change/delete via new websocket message on the existing channel
  • Use a /tmp folder path so the server can safely persist the files to disk
  • Use file update time to make sure out-of-order websocket message does not overwrite a valid version
  • Add getWorkingCopyServiceOverride so it autoSave setting would work
  • defaultHtmlAugmentationInstructions was adding a div with no class that was screwing up the layout which is why your CSS needed to use "95vh". This approach makes it scales to 100% of parent which is much easier to use that viewport fixed percentage.
  • Sends a "pipInstall" command that create a venv on the servers and installs from requirements.txt

TODO:

  • The custom websocket message needs to be filtered out and not forwarded to Pyright not sure how to do this
  • Debugger needs work, I had to disable it because it seems to have its file syncing but one-time
  • If you add a new file, then pyright does not detect it and will fail to import. I tried to add --verbose to pyright to debug this, but I cannot see any output. "createServerProcess" seems to be messing around with stdout, so I have no idea where the logs for pyright are going.
  • Get imports from external libraries to work, according to the import resolution for PyRight it seems to assume a single project is running. I have no idea how to convince it use the venv for each active workspace. https://github.com/microsoft/pyright/blob/main/docs/import-resolution.md

justinmann avatar Feb 22 '25 01:02 justinmann