-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Apply mergeConfigurations for browse.path, auto-update the config, and avoid accumulating old configs #13678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -841,6 +841,7 @@ | |||
}, | |||
"C_Cpp.default.mergeConfigurations": { | |||
"type": "boolean", | |||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "false" was already implicitly being used as the default, so setting it to false here just made it explicit was already being used as the default.
@@ -2181,6 +2186,7 @@ export class DefaultClient implements Client { | |||
if (configs && configs.length > 0 && configs[0]) { | |||
const fileConfiguration: configs.Configuration | undefined = this.configuration.CurrentConfiguration; | |||
if (fileConfiguration?.mergeConfigurations) { | |||
configs = deepCopy(configs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line change fixes the duplicates/old values being accumulated: #13687
@@ -1810,3 +1810,21 @@ export function findExePathInArgs(args: CommandString[]): string | undefined { | |||
export function getVsCodeVersion(): number[] { | |||
return vscode.version.split('.').map(num => parseInt(num, undefined)); | |||
} | |||
|
|||
export function equals(array1: string[] | undefined, array2: string[] | undefined): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript confusingly was returning false with array1 == array2 even though the contents of the arrays were identical.
Fix for the configurationProvider case of #13660, #13687, and #13688 (the changed mergeable property isn't auto-updated and old config values are accumulated). #13689 is not fixed.
Also, updated the description of mergeConfigurations.
Also, removed the "string" type for mergeConfigurations, since that appears to be invalid.
mergeConfigurations currently is not used by compileCommands (so that behavior is unchanged and has browse.path merged, but other properties not merged unless there is a fallback from a file not configured from compileCommands).