mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
Re-enabled file system watcher for VS Code extension but only in cases where "checkOnlyOpenFiles" is set to false.
This commit is contained in:
parent
05436ce03a
commit
6f139ce932
@ -616,19 +616,17 @@ function updateOptionsAndRestartService(workspace: WorkspaceServiceInstance,
|
||||
typeStubTargetImportName?: string) {
|
||||
|
||||
const commandLineOptions = new CommandLineOptions(workspace.rootPath, true);
|
||||
|
||||
// Disable watching of source files in the VS Code extension. This
|
||||
// was previously enabled, but the file system watcher code caused
|
||||
// lots of problems across multiple platforms. The benefit it provides
|
||||
// (being able to catch changes made to files outside of VS Code) are
|
||||
// not worth the problems it causes.
|
||||
commandLineOptions.watch = false;
|
||||
|
||||
commandLineOptions.checkOnlyOpenFiles = pyrightSettings ?
|
||||
!!pyrightSettings.openFilesOnly : true;
|
||||
commandLineOptions.useLibraryCodeForTypes = pyrightSettings ?
|
||||
!!pyrightSettings.useLibraryCodeForTypes : false;
|
||||
|
||||
// Disable watching of source files in the VS Code extension if we're
|
||||
// analyzing only open files. The file system watcher code has caused
|
||||
// lots of problems across multiple platforms. It provides little or
|
||||
// no benefit when we're in "openFilesOnly" mode.
|
||||
commandLineOptions.watch = !commandLineOptions.checkOnlyOpenFiles;
|
||||
|
||||
if (pythonSettings.venvPath) {
|
||||
commandLineOptions.venvPath = combinePaths(workspace.rootPath || _rootPath,
|
||||
normalizePath(_expandPathVariables(pythonSettings.venvPath)));
|
||||
|
Loading…
Reference in New Issue
Block a user