-
Notifications
You must be signed in to change notification settings - Fork 765
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
How to explicitly specify that Pylance only scans specific a few directories in a large multi-root workspace #5794
Comments
Hi @vbem, if you don't want certain directories or paths to be included in the analysis, you can do the followings:
"settings": {
"python.analysis.exclude": ["full path of directories or files"]
} Globbing is supported, so please refer to this doc for more details. Please use full paths for now as I found a bug with using variables like |
Thanks a lot for your guidance @StellaHuang95 . I added other non-python directories (full-path) into |
I believe you need to actually use a glob like so:
The |
Thanks a lot for your hints. But is it possible to disable/enable pylance scanning instances for certain project-directories? Because in a large multi-root workspace with only 1 python related project-directory, user still need to wait all scanning instance done before working on the python directory, which consumes a lot of unnecessary time and resources. |
Sorry there's no way to completely ignore a workspace folder. The ignore logic is actually independent of the folder handling. Internally there should be no scanning. We will create data structures to track those other folders, but then any documents in that folder will be marked as skipped. The only work that should happen is that it finds no source or files in those folders. |
you can have folder specific setting for multi workspaces in vscode using this - https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspace-settings for your specific issue, create and add
any setting in |
I've tried this but unfortunately it doesn't prevent pylance instances from starting and consequently using a big slice of RAM (around 2 GB for 30 roots) in a devcontainer. Are there any other workarounds? |
@djettah can you take a look at https://github.com/microsoft/pylance-release/wiki/Opening-Large-Workspaces-in-VS-Code ? that should have more detail instructions on how to set up large workspace. |
Hi, I have a large multi-root workspace containing many project-directories, but only a few among them are Python related. Every time a start VScode, the Pylance starts scanning every project-directory in my multi-root workspace, it consumes several minutes before I can work in Python related project-directories.
Is it possible I can limit the directories Pylance will scan in a multi-root workspace? Thanks in advance.
The text was updated successfully, but these errors were encountered: