File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -998,10 +998,15 @@ export class CppProperties {
998998 } else if ( configuration . includePath ) {
999999 // If the user doesn't set browse.path, copy the includePath over. Make sure ${workspaceFolder} is in there though...
10001000 configuration . browse . path = configuration . includePath . slice ( 0 ) ;
1001- if ( configuration . includePath . findIndex ( ( value : string ) =>
1002- ! ! value . match ( / ^ \$ \{ ( w o r k s p a c e R o o t | w o r k s p a c e F o l d e r ) \} ( \\ \* { 0 , 2 } | \/ \* { 0 , 2 } ) ? $ / g) ) === - 1
1003- ) {
1004- configuration . browse . path . push ( "${workspaceFolder}" ) ;
1001+ if ( this . rootUri ) {
1002+ let normalizedRootUriFsPath : string = escapeStringRegExp ( this . rootUri . fsPath . replace ( / \\ / g, "/" ) ) ;
1003+ let regexPattern = `^${ normalizedRootUriFsPath } (\\*{0,2}|\/\\*{0,2})?$` ;
1004+ let regex = new RegExp ( regexPattern , "g" ) ;
1005+ if ( configuration . includePath . findIndex ( ( value : string ) =>
1006+ ! ! value . match ( regex ) ) === - 1
1007+ ) {
1008+ configuration . browse . path . push ( "${workspaceFolder}" ) ;
1009+ }
10051010 }
10061011 } else {
10071012 configuration . browse . path = [ "${workspaceFolder}" ] ;
You can’t perform that action at this time.
0 commit comments