From 0d0e0042de53f26c1d1eac0173e54292bb8a0cdc Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 20 Apr 2020 11:35:38 -0700 Subject: [PATCH] Fix duplicate config squiggles. (#5323) --- Extension/src/LanguageServer/configurations.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index fee41f8212..f88c0ed9b5 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -1300,8 +1300,16 @@ export class CppProperties { const compilerPathStart: number = curText.search(/\s*\"compilerPath\"\s*:\s*\"/); const compilerPathEnd: number = compilerPathStart === -1 ? -1 : curText.indexOf('"', curText.indexOf('"', curText.indexOf(":", compilerPathStart)) + 1) + 1; + let processedPaths: Set = new Set(); + // Validate paths for (let curPath of paths) { + if (processedPaths.has(curPath)) { + // Avoid duplicate squiggles for the same line. + // Squiggles for the same path on different lines are already handled below. + continue; + } + processedPaths.add(curPath); const isCompilerPath: boolean = curPath === currentConfiguration.compilerPath; // Resolve special path cases. if (curPath === "${default}") {