From b950fe0be9013d35636d56f47110f7ef86832774 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 6 Jul 2018 12:32:12 -0700 Subject: [PATCH 1/2] Fix bug c_cpp_properties.json creation after being deleted. --- Extension/src/LanguageServer/configurations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 0cd2416c3..8f8ede69a 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -497,7 +497,7 @@ export class CppProperties { if (!e || e.code === 'EEXIST') { let dirPathEscaped: string = this.configFolder.replace("#", "%23"); let fullPathToFile: string = path.join(dirPathEscaped, "c_cpp_properties.json"); - let filePath: vscode.Uri = vscode.Uri.parse("untitled:" + fullPathToFile); + let filePath: vscode.Uri = vscode.Uri.file(fullPathToFile).with({ scheme: "untitled" }); vscode.workspace.openTextDocument(filePath).then((document: vscode.TextDocument) => { let edit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit(); if (this.configurationJson) { From 96057a49911793c016f1f92bf8c1a2a7de24b988 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 6 Jul 2018 12:41:05 -0700 Subject: [PATCH 2/2] Fix paths with #. --- Extension/src/LanguageServer/configurations.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 8f8ede69a..a1752d216 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -495,8 +495,7 @@ export class CppProperties { } else { fs.mkdir(this.configFolder, (e: NodeJS.ErrnoException) => { if (!e || e.code === 'EEXIST') { - let dirPathEscaped: string = this.configFolder.replace("#", "%23"); - let fullPathToFile: string = path.join(dirPathEscaped, "c_cpp_properties.json"); + let fullPathToFile: string = path.join(this.configFolder, "c_cpp_properties.json"); let filePath: vscode.Uri = vscode.Uri.file(fullPathToFile).with({ scheme: "untitled" }); vscode.workspace.openTextDocument(filePath).then((document: vscode.TextDocument) => { let edit: vscode.WorkspaceEdit = new vscode.WorkspaceEdit();