-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python imports not working in demo app #865
Comments
You can refer to this answer #861 |
Is there any way to override PyRight's file loading? If so, we should be able to redirect the file loading call over the WebSocket connection and return the file from the browser. It looks like PyRight uses a FileSystem interface retrieved from its internal serviceProvider to handle file ops: In the demo app, it looks like pyright is run as an external process:
In step 2 the serviceProvider is injected, by bringing pyright in-process or by creating a new pyright server start wrapper, you could override the FileSystem interface in the serviceProvider. |
Hi @justinmann honestly I don't know much about pyright. If you have questions regarding it please ask in their repository. The one thing we want to support and integrate at some point is that the client and the express app that controls the language server start and communication can sync the file systems of the "remote" client and its own. This is covered by #834 The clangd language server that runs as wasm/web worker does something like this already, but in the context of web workers. We want to generalize this and make tool available . |
What if you modify RegisteredFileSystemProvider to connect with the language server to push the file system changes to the server? Specifically:
To handle the global imports, you could create a .venv folder and run pip install (on the language server) whenever requirements.txt file changes. If you want to get fancy, you could also monitor the language server file system to make this a bi-directional sync. I would think this approach would also enable remote execution & debugging. |
Local imports do not seem to work

Package imports do not seem to work
According to this doc, https://microsoft.github.io/pyright/#/import-resolution, it will fallback to the local python interpreter to find packages. I made to pip install matplotlib in my local machine before starting the language server and no luck
The text was updated successfully, but these errors were encountered: