add placeholder to clients map to prevent >1 instance per folder

master
Brad Cornes 2019-01-06 14:36:26 +00:00
parent 163c3fc633
commit 318debc41f
1 changed files with 6 additions and 1 deletions

View File

@ -97,6 +97,9 @@ export async function activate(context: ExtensionContext) {
folder = getOuterMostWorkspaceFolder(folder)
if (!clients.has(folder.uri.toString())) {
// placeholder
clients.set(folder.uri.toString(), null)
let files = await Workspace.findFiles(
CONFIG_GLOB,
'**/node_modules/**',
@ -182,7 +185,9 @@ export function deactivate(): Thenable<void> {
promises.push(defaultClient.stop())
}
for (let client of clients.values()) {
promises.push(client.stop())
if (client) {
promises.push(client.stop())
}
}
return Promise.all(promises).then(() => undefined)
}