mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
commit
e608a9def3
@ -355,18 +355,20 @@ function updateOptionsAndRestartService(settings?: Settings) {
|
||||
});
|
||||
}
|
||||
|
||||
_connection.workspace.onDidChangeWorkspaceFolders(event => {
|
||||
event.removed.forEach(workspace => {
|
||||
const rootPath = _convertUriToPath(workspace.uri);
|
||||
_workspaceMap.delete(rootPath);
|
||||
});
|
||||
|
||||
event.added.forEach(workspace => {
|
||||
const rootPath = _convertUriToPath(workspace.uri);
|
||||
_workspaceMap.set(rootPath, {
|
||||
workspaceName: workspace.name,
|
||||
rootPath: rootPath,
|
||||
serviceInstance: _createAnalyzerService()
|
||||
_connection.onInitialized(() => {
|
||||
_connection.workspace.onDidChangeWorkspaceFolders(event => {
|
||||
event.removed.forEach(workspace => {
|
||||
const rootPath = _convertUriToPath(workspace.uri);
|
||||
_workspaceMap.delete(rootPath);
|
||||
});
|
||||
|
||||
event.added.forEach(workspace => {
|
||||
const rootPath = _convertUriToPath(workspace.uri);
|
||||
_workspaceMap.set(rootPath, {
|
||||
workspaceName: workspace.name,
|
||||
rootPath: rootPath,
|
||||
serviceInstance: _createAnalyzerService()
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user