pylance-release
pylance-release copied to clipboard
provide standalone file mode
some users are using vscode as if it is glorified notepad. basically launch vscode as code . whenever they need to take a look at a python file.
problem is when they do (code .), vscode is opened as a folder mode that will provide all workspace wide features such as find all references, rename, workspace symbols, call hierarchy, type hierarchy, pytest and etc.
pylance might consider a way to open it as standalone file mode where we act like files are opened as individual files. this mode we won't support those workspace file features but will use a lot less memory since we only support open files as if those files are opened individually.
user could already do this by opening each file explicitly, but problem is vscode explorer won't show content of folders so it is inconvenience when user wants to see multiple files in the folder.
Your hypothesis here is that a user doing code . isn't really opening a workspace, they just want to look at their python file in the same directory?
How would we distinguish the two? (I personally use code . to open a workspace, it's how I open pyrx).
Maybe a .git folder? That's probably a workspace.
And maybe only do the disabling if the workspace has a lot of files in it.
I am not suggesting how we do it, but we could
- add an option either true/false, or
- specify folder (anything under it is standalone file mode) in machine/user settings and etc.
- or we provide new command line option for users if we can detect it in our extension
- or something else
and probably show something in status bar to indicate that pylance is in standalone file mode?