mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Added support for "python.analysis.autoSearchPaths" setting. If enabled (as it is by default), it automatically adds "src" to the import search paths. It is common for workspaces to contain a directory by this name.
This commit is contained in:
parent
175a068bbd
commit
921de3097e
@ -75,6 +75,12 @@
|
|||||||
"description": "Paths to look for typeshed modules.",
|
"description": "Paths to look for typeshed modules.",
|
||||||
"scope": "resource"
|
"scope": "resource"
|
||||||
},
|
},
|
||||||
|
"python.analysis.autoSearchPaths": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Automatically add common search paths like 'src'?",
|
||||||
|
"scope": "resource"
|
||||||
|
},
|
||||||
"python.pythonPath": {
|
"python.pythonPath": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "python",
|
"default": "python",
|
||||||
|
@ -14,6 +14,8 @@ The Pyright VS Code extension honors the following settings.
|
|||||||
|
|
||||||
**python.analysis.typeshedPaths** [array of paths]: Paths to look for typeshed modules. Pyright currently honors only the first path in the array.
|
**python.analysis.typeshedPaths** [array of paths]: Paths to look for typeshed modules. Pyright currently honors only the first path in the array.
|
||||||
|
|
||||||
|
**python.analysis.autoSearchPaths** [boolean]: Determines whether pyright automatically adds common search paths like "src" if there are no execution environments defined in the config file.
|
||||||
|
|
||||||
**python.pythonPath** [path]: Path to Python interpreter.
|
**python.pythonPath** [path]: Path to Python interpreter.
|
||||||
|
|
||||||
**python.venvPath** [path]: Path to folder with subdirectories that contain virtual environments.
|
**python.venvPath** [path]: Path to folder with subdirectories that contain virtual environments.
|
||||||
|
@ -45,7 +45,7 @@ class PyrightServer extends LanguageServerBase {
|
|||||||
}
|
}
|
||||||
serverSettings.autoSearchPaths = !!pythonAnalysisSection.autoSearchPaths;
|
serverSettings.autoSearchPaths = !!pythonAnalysisSection.autoSearchPaths;
|
||||||
} else {
|
} else {
|
||||||
serverSettings.autoSearchPaths = false;
|
serverSettings.autoSearchPaths = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pyrightSection = await this.getConfiguration(workspace, 'pyright');
|
const pyrightSection = await this.getConfiguration(workspace, 'pyright');
|
||||||
|
Loading…
Reference in New Issue
Block a user