Merge pull request #171 from higoshi/fix

fix #170
This commit is contained in:
Eric Traut 2019-07-18 07:36:19 -07:00 committed by GitHub
commit e608a9def3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
});
});
});
});