-
Notifications
You must be signed in to change notification settings - Fork 769
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 language features not working with mounted folder via sshfs #1538
Comments
I believe this is a duplicate of #962. |
@jakebailey could you please elaborate on how is this related to #962? My problem happens when working on the Linux machine directly without a remote interpreter. You might have misunderstood, I am not working via ssh remote extension, I am working directly on a Linux machine, it is only that I have a folder mounted via sshfs to another system. I have only mentioned WSL2 because this problem occurs on that system as well, so it must be replicable. |
Whose "sshfs" are you referring to? Provided by VS Code, or is it a mount in the FS directly via FUSE or similar? |
@jakebailey Thanks for reponening. |
That is strange; if you're just FUSE mounting, we shouldn't really treat it any differently than another directory. Sorry to close; VS Code has an SSHFS system that's virtual, but if you're on disk, then we should be able to work as expected. Since this issue was transferred, can you enable trace logging and provide Pylance's logs? Our issue instructions are mirrored here: https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue |
Yeah there is indeed something wrong with pathing here. |
[Info - 9:00:37 PM] Pylance language server 2021.7.2 (pyright adb49aaa) starting |
Might be somehow related to this one: microsoft/pyright#1159 |
The file watching error is a red herring, and only matters for library watches for package installs, which is #923. If that's the end of the log, it's stopping at the source file discovery phase. Does this folder contain any symlinks that go to large folders somewhere else? |
Yes I mean the "/home/abogun/Shares/dgx" is the mount to a huge folder on a server (different from the host machine). I have tried again with not having folder opened in VS code, but rather opening just the file, and language server works fine. After Follows this and much more.... but everything works fine |
Single file mode means we won't have a workspace to scan, so that's why that appears to work (but has its own problems; #1300 and others). dgx may be huge, but I'm specifically talking about the folder you're opening; we only look at files in the workspace, but if there are symlinks that go out, we may be getting stuck. |
The folder I am opening "ensemble" is inside of "dgx" mount, but as far as I know, it should not have any symlinks. |
there are however symlinks on my system path. I mean in my Linux home directory there is a symlink to a folder elsewhere. |
Still, I have this setup for quite some time and everything used to be fine. |
My guess is that pylance is enumerating the files in the workspace, and it's taking a very long time because it's remote and there are many files and directories to scan. |
Yeah, this seems plausible, is there a way to exclude directories from the workspace? |
The number of files is the key thing; I'm guessing the number of files is compounding with the SSHFS overhead and making it slow to do the workspace scan.
Are you saying that this is a new change and was working in a previous version of Pylance, or that you have just started using Pylance and you're seeing this? Given this was transferred, you may have been using Jedi previously ( |
Yes, with a |
This issue happens with every Language Server I have tried. |
Yeah, putting all large directories inside pyrightconfig.json exclude section, solved everything. Note to self: I should have put code not in the parent folder of a project but in a subfolder "code" and open that in VSCode. Thank you for your help. Much appreciated! |
Environment data
python.languageServer
setting: tried all of themExpected behaviour
Intellisense (code completion) and lining working properly always
Actual behavior
When I have a folder opened (project_folder) in VS-Code AND I have a mounted directory via sshfs INSIDE of this project_folder the following features are not working in any Python file:
Basically, the only Python-specific feature that IS working is syntax highlighting, other than that it is as if language is not selected.
If there are no mounted directories in project_folder OR if VS-Code does not have folder opened (e.g. I directly open file via file->open) everything works as expected.
I assume this is somehow related to python search path, i.e. something is trying to search the current path, gets to the mounted folder and somehow fails. Strangely this does not happen if VS-Code is not in an opened folder mode.
I have tried all Python language servers with the same result.
I have also tried to look into language server and extension logs on remote, but have not found anything wrong.
I have also tried it on WSL2-Ubuntu18 and on Ubuntu18 proper with the same outcome.
Everything has worked fine a couple of months ago, so something must have been changed recently.
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: