Skip to content

Commit 250ad50

Browse files
authored
Merge branch 'main' into seanmcm/removeAlwaysAuth
2 parents 17f90e5 + 00f0915 commit 250ad50

14 files changed

+504
-345
lines changed

.github/actions/package-lock.json

Lines changed: 205 additions & 213 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"author": "",
1212
"dependencies": {
1313
"@actions/core": "^1.9.1",
14-
"@actions/github": "^5.0.3",
15-
"@octokit/rest": "^19.0.3",
14+
"@actions/github": "^6.0.0",
15+
"@octokit/rest": "^21.1.1",
1616
"@slack/web-api": "^6.9.1",
1717
"applicationinsights": "^2.5.1",
1818
"axios": "^1.8.2",

Extension/c_cpp_properties.schema.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@
180180
"mergeConfigurations": {
181181
"markdownDescription": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.",
182182
"descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.",
183-
"type": "boolean"
183+
"type": [
184+
"boolean",
185+
"string"
186+
]
184187
},
185188
"browse": {
186189
"type": "object",
@@ -208,6 +211,42 @@
208211
},
209212
"additionalProperties": false
210213
},
214+
"recursiveIncludes": {
215+
"type": "object",
216+
"properties": {
217+
"reduce": {
218+
"markdownDescription": "Set to `always` to always reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which headers are included. Set to `never` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide. The `default` value is currently to reduce the number of recursive include paths provided to IntelliSense.",
219+
"descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.",
220+
"type": "string",
221+
"enum": [
222+
"always",
223+
"never",
224+
"default",
225+
"${default}"
226+
]
227+
},
228+
"priority": {
229+
"markdownDescription": "The priority of recursive include paths. If set to `beforeSystemIncludes`, the recursive include paths will be searched before system include paths. If set to `afterSystemIncludes`, the recursive include paths will be searched after system include paths. `beforeSystemIncludes` would more closely reflect the search order of a compiler, while `afterSystemIncludes` may result in improved performance.",
230+
"descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.",
231+
"type": "string",
232+
"enum": [
233+
"beforeSystemIncludes",
234+
"afterSystemIncludes",
235+
"${default}"
236+
]
237+
},
238+
"order": {
239+
"markdownDescription": "The order in which subdirectories of recursive includes are searched.",
240+
"type": "string",
241+
"enum": [
242+
"depthFirst",
243+
"breadthFirst",
244+
"${default}"
245+
]
246+
}
247+
},
248+
"additionalProperties": false
249+
},
211250
"customConfigurationVariables": {
212251
"type": "object",
213252
"markdownDescription": "Custom variables that can be queried through the command `${cpptools:activeConfigCustomVariable}` to use for the input variables in `launch.json` or `tasks.json`.",

Extension/package.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,37 @@
897897
"markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%",
898898
"scope": "resource"
899899
},
900+
"C_Cpp.default.recursiveIncludes.reduce": {
901+
"type": "string",
902+
"enum": [
903+
"always",
904+
"never",
905+
"default"
906+
],
907+
"default": "default",
908+
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%",
909+
"scope": "resource"
910+
},
911+
"C_Cpp.default.recursiveIncludes.priority": {
912+
"type": "string",
913+
"enum": [
914+
"beforeSystemIncludes",
915+
"afterSystemIncludes"
916+
],
917+
"default": "afterSystemIncludes",
918+
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription%",
919+
"scope": "resource"
920+
},
921+
"C_Cpp.default.recursiveIncludes.order": {
922+
"type": "string",
923+
"enum": [
924+
"depthFirst",
925+
"breadthFirst"
926+
],
927+
"default": "depthFirst",
928+
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.order.markdownDescription%",
929+
"scope": "resource"
930+
},
900931
"C_Cpp.configurationWarnings": {
901932
"type": "string",
902933
"enum": [
@@ -3339,7 +3370,8 @@
33393370
"type": "string",
33403371
"enum": [
33413372
"default",
3342-
"disabled"
3373+
"disabled",
3374+
"enabled"
33433375
],
33443376
"default": "default",
33453377
"markdownDescription": "%c_cpp.configuration.copilotHover.markdownDescription%",

Extension/package.nls.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@
682682
]
683683
},
684684
"c_cpp.configuration.default.mergeConfigurations.markdownDescription": {
685-
"message": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.",
685+
"message": "The value to use in a configuration if `mergeConfigurations` is either not specified or set to `${default}`.",
686686
"comment": [
687687
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
688688
]
@@ -724,7 +724,25 @@
724724
]
725725
},
726726
"c_cpp.configuration.default.dotConfig.markdownDescription": {
727-
"message": "The value to use in a configuration if `dotConfig` is not specified, or the value to insert if `${default}` is present in `dotConfig`.",
727+
"message": "The value to use in a configuration if `dotConfig` is either not specified or set to `${default}`.",
728+
"comment": [
729+
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
730+
]
731+
},
732+
"c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription": {
733+
"message": "The value to use in a configuration if `recursiveIncludes.reduce` is either not specified or set to `${default}`.",
734+
"comment": [
735+
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
736+
]
737+
},
738+
"c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription": {
739+
"message": "The value to use in a configuration if `recursiveIncludes.priority` is either not specified or set to `${default}`.",
740+
"comment": [
741+
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
742+
]
743+
},
744+
"c_cpp.configuration.default.recursiveIncludes.order.markdownDescription": {
745+
"message": "The value to use in a configuration if `recursiveIncludes.order` is either not specified or set to `${default}`.",
728746
"comment": [
729747
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
730748
]

Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export class CopilotHoverProvider implements vscode.HoverProvider {
3333
await this.client.ready;
3434

3535
const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
36-
if (settings.hover === "disabled") {
36+
if (settings.hover === "disabled" ||
37+
settings.copilotHover === "disabled" ||
38+
(settings.copilotHover === "default" && await telemetry.isFlightEnabled("CppCopilotHoverDisabled"))) {
39+
// Either disabled by the user or by the flight.
3740
return undefined;
3841
}
3942

@@ -46,13 +49,6 @@ export class CopilotHoverProvider implements vscode.HoverProvider {
4649
}
4750
}
4851

49-
if (new CppSettings().copilotHover === "default") {
50-
// Check flight to make sure the feature is enabled.
51-
if (!await telemetry.isFlightEnabled("CppCopilotHover")) {
52-
return undefined;
53-
}
54-
}
55-
5652
const newHover = this.isNewHover(document, position);
5753
if (newHover) {
5854
this.reset();

Extension/src/LanguageServer/client.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,17 +1332,9 @@ export class DefaultClient implements Client {
13321332
initializedClientCount = 0;
13331333
this.inlayHintsProvider = new InlayHintsProvider();
13341334
this.hoverProvider = new HoverProvider(this);
1335+
this.copilotHoverProvider = new CopilotHoverProvider(this);
13351336

1336-
const settings: CppSettings = new CppSettings();
1337-
this.currentCopilotHoverEnabled = new PersistentWorkspaceState<string>("cpp.copilotHover", settings.copilotHover);
1338-
if (settings.copilotHover !== "disabled") {
1339-
this.copilotHoverProvider = new CopilotHoverProvider(this);
1340-
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.copilotHoverProvider)));
1341-
}
1342-
1343-
if (settings.copilotHover !== this.currentCopilotHoverEnabled.Value) {
1344-
this.currentCopilotHoverEnabled.Value = settings.copilotHover;
1345-
}
1337+
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.copilotHoverProvider)));
13461338
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.hoverProvider)));
13471339
this.disposables.push(vscode.languages.registerInlayHintsProvider(util.documentSelector, instrument(this.inlayHintsProvider)));
13481340
this.disposables.push(vscode.languages.registerRenameProvider(util.documentSelector, instrument(new RenameProvider(this))));
@@ -1362,6 +1354,7 @@ export class DefaultClient implements Client {
13621354
this.codeFoldingProvider = new FoldingRangeProvider(this);
13631355
this.codeFoldingProviderDisposable = vscode.languages.registerFoldingRangeProvider(util.documentSelector, instrument(this.codeFoldingProvider));
13641356

1357+
const settings: CppSettings = new CppSettings();
13651358
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
13661359
this.semanticTokensProvider = instrument(new SemanticTokensProvider());
13671360
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);

Extension/src/LanguageServer/configurations.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ export interface Configuration {
8383
forcedInclude?: string[];
8484
configurationProviderInCppPropertiesJson?: string;
8585
configurationProvider?: string;
86-
mergeConfigurations?: boolean;
86+
mergeConfigurations?: boolean | string;
8787
browse?: Browse;
88+
recursiveIncludes?: RecursiveIncludes;
8889
customConfigurationVariables?: { [key: string]: string };
8990
}
9091

@@ -107,6 +108,12 @@ export interface Browse {
107108
databaseFilename?: string;
108109
}
109110

111+
export interface RecursiveIncludes {
112+
reduce?: string;
113+
priority?: string;
114+
order?: string;
115+
}
116+
110117
export interface KnownCompiler {
111118
path: string;
112119
isC: boolean;
@@ -813,13 +820,16 @@ export class CppProperties {
813820
return resolvedGlob;
814821
}
815822

816-
private updateConfigurationString(property: string | undefined | null, defaultValue: string | undefined | null, env: Environment, acceptBlank?: boolean): string | undefined {
823+
private updateConfigurationString(property: string | undefined | null, defaultValue: string | undefined | null, env?: Environment, acceptBlank?: boolean): string | undefined {
817824
if (property === null || property === undefined || property === "${default}") {
818825
property = defaultValue;
819826
}
820827
if (property === null || property === undefined || (acceptBlank !== true && property === "")) {
821828
return undefined;
822829
}
830+
if (env === undefined) {
831+
return property;
832+
}
823833
return util.resolveVariables(property, env);
824834
}
825835

@@ -843,29 +853,16 @@ export class CppProperties {
843853
return paths;
844854
}
845855

846-
private updateConfigurationStringOrBoolean(property: string | boolean | undefined | null, defaultValue: boolean | undefined | null, env: Environment): string | boolean | undefined {
847-
if (!property || property === "${default}") {
848-
property = defaultValue;
849-
}
850-
if (!property || property === "") {
851-
return undefined;
852-
}
853-
if (typeof property === "boolean") {
854-
return property;
855-
}
856-
return util.resolveVariables(property, env);
857-
}
858-
859-
private updateConfigurationBoolean(property: boolean | undefined | null, defaultValue: boolean | undefined | null): boolean | undefined {
860-
if (property === null || property === undefined) {
856+
private updateConfigurationBoolean(property: boolean | string | undefined | null, defaultValue: boolean | undefined | null): boolean | undefined {
857+
if (property === null || property === undefined || property === "${default}") {
861858
property = defaultValue;
862859
}
863860

864861
if (property === null) {
865862
return undefined;
866863
}
867864

868-
return property;
865+
return property === true || property === "true";
869866
}
870867

871868
private updateConfigurationStringDictionary(property: { [key: string]: string } | undefined, defaultValue: { [key: string]: string } | undefined, env: Environment): { [key: string]: string } | undefined {
@@ -939,6 +936,12 @@ export class CppProperties {
939936
configuration.cStandardIsExplicit = configuration.cStandardIsExplicit || settings.defaultCStandard !== "";
940937
configuration.cppStandardIsExplicit = configuration.cppStandardIsExplicit || settings.defaultCppStandard !== "";
941938
configuration.mergeConfigurations = this.updateConfigurationBoolean(configuration.mergeConfigurations, settings.defaultMergeConfigurations);
939+
if (!configuration.recursiveIncludes) {
940+
configuration.recursiveIncludes = {};
941+
}
942+
configuration.recursiveIncludes.reduce = this.updateConfigurationString(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce);
943+
configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority);
944+
configuration.recursiveIncludes.order = this.updateConfigurationString(configuration.recursiveIncludes.order, settings.defaultRecursiveIncludesOrder);
942945
if (!configuration.compileCommands) {
943946
// compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so
944947
// don't set a default when compileCommands is in use.
@@ -1002,7 +1005,7 @@ export class CppProperties {
10021005
configuration.browse.path = this.updateConfigurationPathsArray(configuration.browse.path, settings.defaultBrowsePath, env);
10031006
}
10041007

1005-
configuration.browse.limitSymbolsToIncludedHeaders = this.updateConfigurationStringOrBoolean(configuration.browse.limitSymbolsToIncludedHeaders, settings.defaultLimitSymbolsToIncludedHeaders, env);
1008+
configuration.browse.limitSymbolsToIncludedHeaders = this.updateConfigurationBoolean(configuration.browse.limitSymbolsToIncludedHeaders, settings.defaultLimitSymbolsToIncludedHeaders);
10061009
configuration.browse.databaseFilename = this.updateConfigurationString(configuration.browse.databaseFilename, settings.defaultDatabaseFilename, env);
10071010

10081011
if (i === this.CurrentConfigurationIndex) {

Extension/src/LanguageServer/copilotCompletionContextProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class CopilotCompletionContextProvider implements ContextResolver<Support
197197
}
198198
return undefined;
199199
} finally {
200-
out.appendLine(logMessage);
200+
out.appendLineAtLevel(6, logMessage);
201201
telemetry.send("cache");
202202
}
203203
}
@@ -341,7 +341,7 @@ ${copilotCompletionContext?.areCodeSnippetsMissing ? " missing code-snippets" :
341341
telemetry.addResolvedElapsed(duration);
342342
telemetry.addCacheSize(this.completionContextCache.size);
343343
telemetry.send();
344-
out.appendLine(logMessage);
344+
out.appendLineAtLevel(6, logMessage);
345345
}
346346
}
347347

0 commit comments

Comments
 (0)