Skip to content

Merge for 1.24.4 #13419

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

Merged
merged 11 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
418 changes: 205 additions & 213 deletions .github/actions/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"author": "",
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/github": "^5.0.3",
"@octokit/rest": "^19.0.3",
"@actions/github": "^6.0.0",
"@octokit/rest": "^21.1.1",
"@slack/web-api": "^6.9.1",
"applicationinsights": "^2.5.1",
"axios": "^1.8.2",
Expand Down
19 changes: 5 additions & 14 deletions Build/cg/cg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,26 @@ extends:
inputs:
version: 18.x

- task: CmdLine@2
- script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc
displayName: Delete .npmrc if it exists
inputs:
script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc

- task: Npm@0
name: NpmInstall_2
displayName: Install vsce
inputs:
arguments: --global @vscode/vsce

- task: CmdLine@1
name: ProcessRunner_11
- script: mkdir $(Build.ArtifactStagingDirectory)\Extension
displayName: Create Extension Staging Directory
inputs:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\Extension

- script: yarn run vsix-prepublish
displayName: Build files
workingDirectory: $(Build.SourcesDirectory)\Extension

- task: CmdLine@1
- script: |
cd $(Build.SourcesDirectory)\Extension
vsce package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
name: ProcessRunner_12
displayName: Run VSCE to package vsix
inputs:
filename: vsce
arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix
workingFolder: $(Build.SourcesDirectory)\Extension

- task: Npm@0
displayName: Uninstall vsce
Expand Down
13 changes: 4 additions & 9 deletions Build/package/jobs_package_vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@ jobs:
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: Use Yarn 1.x

- task: CmdLine@1
- script: mkdir $(Build.ArtifactStagingDirectory)\vsix
displayName: Create Staging Directory
inputs:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\vsix

- task: CmdLine@1
- script: |
cd $(Build.SourcesDirectory)\${{ parameters.srcDir }}
vsce package -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
displayName: Run VSCE to package vsix
inputs:
filename: vsce
arguments: package -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
workingFolder: $(Build.SourcesDirectory)\${{ parameters.srcDir }}

- task: Npm@0
displayName: Uninstall vsce
Expand Down
14 changes: 14 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.24.4: March 25, 2025
### Enhancements
* Add a new `recursiveIncludes` property to `c_cpp_properties.json`. [PR #13374](https://github.com/microsoft/vscode-cpptools/pull/13374)
* Turn Copilot hover on by default. [PR #13385](https://github.com/microsoft/vscode-cpptools/pull/13385)
* On shutdown, immediately terminate the IntelliSense process instead of waiting 2 seconds.

### Bug Fixes
* Fix one potential cause of the `get_mangled_function_name` IntelliSense process crash. [#13358](https://github.com/Microsoft/vscode-cpptools/issues/13358)
* Fix Copilot-related logging appearing when it shouldn't. [PR #13388](https://github.com/microsoft/vscode-cpptools/pull/13388)
* Fix relative compiler paths being expanded in `compile_commands.json`. [#13405](https://github.com/microsoft/vscode-cpptools/issues/13405)
* Fix all caps clang-format logging on Windows. [#13406](https://github.com/microsoft/vscode-cpptools/issues/13406)
* Fix an IntelliSense process crash in `handle_function`.
* Avoid reporting an error due to multiple `didOpen` requests after a crash.

## Version 1.24.3: March 18, 2025
### Enhancements
* Add detected test frameworks to the Copilot context when `#cpp` is used. [PR #13285](https://github.com/microsoft/vscode-cpptools/pull/13285)
Expand Down
41 changes: 40 additions & 1 deletion Extension/c_cpp_properties.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@
"mergeConfigurations": {
"markdownDescription": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.",
"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.",
"type": "boolean"
"type": [
"boolean",
"string"
]
},
"browse": {
"type": "object",
Expand Down Expand Up @@ -208,6 +211,42 @@
},
"additionalProperties": false
},
"recursiveIncludes": {
"type": "object",
"properties": {
"reduce": {
"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.",
"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.",
"type": "string",
"enum": [
"always",
"never",
"default",
"${default}"
]
},
"priority": {
"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.",
"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.",
"type": "string",
"enum": [
"beforeSystemIncludes",
"afterSystemIncludes",
"${default}"
]
},
"order": {
"markdownDescription": "The order in which subdirectories of recursive includes are searched.",
"type": "string",
"enum": [
"depthFirst",
"breadthFirst",
"${default}"
]
}
},
"additionalProperties": false
},
"customConfigurationVariables": {
"type": "object",
"markdownDescription": "Custom variables that can be queried through the command `${cpptools:activeConfigCustomVariable}` to use for the input variables in `launch.json` or `tasks.json`.",
Expand Down
37 changes: 34 additions & 3 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.24.3-main",
"version": "1.24.4-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
Expand Down Expand Up @@ -897,6 +897,37 @@
"markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%",
"scope": "resource"
},
"C_Cpp.default.recursiveIncludes.reduce": {
"type": "string",
"enum": [
"always",
"never",
"default"
],
"default": "default",
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%",
"scope": "resource"
},
"C_Cpp.default.recursiveIncludes.priority": {
"type": "string",
"enum": [
"beforeSystemIncludes",
"afterSystemIncludes"
],
"default": "afterSystemIncludes",
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription%",
"scope": "resource"
},
"C_Cpp.default.recursiveIncludes.order": {
"type": "string",
"enum": [
"depthFirst",
"breadthFirst"
],
"default": "depthFirst",
"markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.order.markdownDescription%",
"scope": "resource"
},
"C_Cpp.configurationWarnings": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -3339,7 +3370,8 @@
"type": "string",
"enum": [
"default",
"disabled"
"disabled",
"enabled"
],
"default": "default",
"markdownDescription": "%c_cpp.configuration.copilotHover.markdownDescription%",
Expand Down Expand Up @@ -6580,7 +6612,6 @@
"gulp-typescript": "^5.0.1",
"minimist": "^1.2.8",
"mocha": "^10.4.0",
"parse-git-config": "^3.0.0",
"parse5": "^7.1.2",
"parse5-traverse": "^1.0.3",
"proxyquire": "^2.1.3",
Expand Down
22 changes: 20 additions & 2 deletions Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
]
},
"c_cpp.configuration.default.mergeConfigurations.markdownDescription": {
"message": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.",
"message": "The value to use in a configuration if `mergeConfigurations` is either not specified or set to `${default}`.",
"comment": [
"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."
]
Expand Down Expand Up @@ -724,7 +724,25 @@
]
},
"c_cpp.configuration.default.dotConfig.markdownDescription": {
"message": "The value to use in a configuration if `dotConfig` is not specified, or the value to insert if `${default}` is present in `dotConfig`.",
"message": "The value to use in a configuration if `dotConfig` is either not specified or set to `${default}`.",
"comment": [
"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."
]
},
"c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription": {
"message": "The value to use in a configuration if `recursiveIncludes.reduce` is either not specified or set to `${default}`.",
"comment": [
"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."
]
},
"c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription": {
"message": "The value to use in a configuration if `recursiveIncludes.priority` is either not specified or set to `${default}`.",
"comment": [
"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."
]
},
"c_cpp.configuration.default.recursiveIncludes.order.markdownDescription": {
"message": "The value to use in a configuration if `recursiveIncludes.order` is either not specified or set to `${default}`.",
"comment": [
"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."
]
Expand Down
12 changes: 4 additions & 8 deletions Extension/src/LanguageServer/Providers/CopilotHoverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export class CopilotHoverProvider implements vscode.HoverProvider {
await this.client.ready;

const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
if (settings.hover === "disabled") {
if (settings.hover === "disabled" ||
settings.copilotHover === "disabled" ||
(settings.copilotHover === "default" && await telemetry.isFlightEnabled("CppCopilotHoverDisabled"))) {
// Either disabled by the user or by the flight.
return undefined;
}

Expand All @@ -46,13 +49,6 @@ export class CopilotHoverProvider implements vscode.HoverProvider {
}
}

if (new CppSettings().copilotHover === "default") {
// Check flight to make sure the feature is enabled.
if (!await telemetry.isFlightEnabled("CppCopilotHover")) {
return undefined;
}
}

const newHover = this.isNewHover(document, position);
if (newHover) {
this.reset();
Expand Down
13 changes: 3 additions & 10 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1332,17 +1332,9 @@ export class DefaultClient implements Client {
initializedClientCount = 0;
this.inlayHintsProvider = new InlayHintsProvider();
this.hoverProvider = new HoverProvider(this);
this.copilotHoverProvider = new CopilotHoverProvider(this);

const settings: CppSettings = new CppSettings();
this.currentCopilotHoverEnabled = new PersistentWorkspaceState<string>("cpp.copilotHover", settings.copilotHover);
if (settings.copilotHover !== "disabled") {
this.copilotHoverProvider = new CopilotHoverProvider(this);
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.copilotHoverProvider)));
}

if (settings.copilotHover !== this.currentCopilotHoverEnabled.Value) {
this.currentCopilotHoverEnabled.Value = settings.copilotHover;
}
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.copilotHoverProvider)));
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, instrument(this.hoverProvider)));
this.disposables.push(vscode.languages.registerInlayHintsProvider(util.documentSelector, instrument(this.inlayHintsProvider)));
this.disposables.push(vscode.languages.registerRenameProvider(util.documentSelector, instrument(new RenameProvider(this))));
Expand All @@ -1362,6 +1354,7 @@ export class DefaultClient implements Client {
this.codeFoldingProvider = new FoldingRangeProvider(this);
this.codeFoldingProviderDisposable = vscode.languages.registerFoldingRangeProvider(util.documentSelector, instrument(this.codeFoldingProvider));

const settings: CppSettings = new CppSettings();
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
this.semanticTokensProvider = instrument(new SemanticTokensProvider());
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);
Expand Down
Loading