Skip to content

Commit 3d81801

Browse files
authored
Eliminate squiggle from all glob configurations (#12072)
* Fix glob coverage * resolve and split paths before validation * expand glob patterns and do not expand incorrect paths * Do not squiggle paths that need to be expanded * revert change * squiggle paths that end with * * Do not squiggle paths that end with * * properly squiggle glob paths with recursive includes * correctly report squiggles with glob paths * move check for asterisk to outer check * fix lint issues
1 parent 74ab0e7 commit 3d81801

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,19 @@ export class CppProperties {
20292029
// and extend that pattern to the next quote before and next quote after it.
20302030
const pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
20312031
const configMatches: string[] | null = curText.match(pattern);
2032-
if (configMatches) {
2032+
2033+
let globPath: boolean = false;
2034+
const asteriskPosition = curPath.indexOf("*");
2035+
if (asteriskPosition !== -1) {
2036+
if (asteriskPosition !== curPath.length - 1 && asteriskPosition !== curPath.length - 2) {
2037+
globPath = true;
2038+
} else if (asteriskPosition === curPath.length - 2) {
2039+
if (curPath[asteriskPosition + 1] !== '*') {
2040+
globPath = true;
2041+
}
2042+
}
2043+
}
2044+
if (configMatches && !globPath) {
20332045
let curOffset: number = 0;
20342046
let endOffset: number = 0;
20352047
for (const curMatch of configMatches) {

0 commit comments

Comments
 (0)