Skip to content

Commit 0351e5f

Browse files
authored
Merge branch 'main' into kuchung/RemoveCompilerArgumentTraits
2 parents ae6b837 + 879202e commit 0351e5f

File tree

15 files changed

+1762
-1463
lines changed

15 files changed

+1762
-1463
lines changed

.github/workflows/job-compile-and-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
runs-on: ${{ inputs.runner-env }}
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323

24-
- name: Use Node.js 16
25-
uses: actions/setup-node@v3
24+
- name: Use Node.js 20
25+
uses: actions/setup-node@v4
2626
with:
27-
node-version: 16
27+
node-version: 20
2828

2929
- name: Install Dependencies
3030
run: yarn install ${{ inputs.yarn-args }}

Build/package/jobs_package_vsix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
displayName: Run VSCE to package vsix
4545
inputs:
4646
filename: vsce
47-
arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
47+
arguments: package -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
4848
workingFolder: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
4949

5050
- task: Npm@0

Extension/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# C/C++ for Visual Studio Code Changelog
22

3-
## Version 1.24.0: Febrary 11, 2025
3+
## Version 1.24.1: February 13, 2025
4+
### Bug Fixes
5+
* Fix random IntelliSense process crashes on Linux/macOS when `C_Cpp.intelliSenseCacheSize` is > 0. [#12668](https://github.com/microsoft/vscode-cpptools/issues/12668)
6+
* Fix a crash when processing Copilot snippets.
7+
* Fix a crash when using Copilot hover.
8+
9+
## Version 1.24.0: February 11, 2025
410
### New Feature
511
* Add experimental support for Copilot descriptions in hover tooltips, controlled by the `C_Cpp.copilotHover` setting. This feature is currently off by default and may be subject to A/B experimentation. To opt-out of Copilot Hover experiments, set `C_Cpp.copilotHover` to `disabled`.
612

Extension/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cpptools",
33
"displayName": "C/C++",
44
"description": "C/C++ IntelliSense, debugging, and code browsing.",
5-
"version": "1.24.0-main",
5+
"version": "1.24.1-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",
@@ -3744,7 +3744,7 @@
37443744
},
37453745
"svdPath": {
37463746
"type": "string",
3747-
"description": "%c_cpp.debuggers.cppdbg.visualizerFile.description",
3747+
"description": "%c_cpp.debuggers.cppdbg.svdPath.description%",
37483748
"default": ""
37493749
},
37503750
"showDisplayString": {
@@ -6542,7 +6542,7 @@
65426542
"build": "yarn prep:dts && echo [Building TypeScript code] && tsc --build tsconfig.json"
65436543
},
65446544
"devDependencies": {
6545-
"@octokit/rest": "^20.1.1",
6545+
"@octokit/rest": "^21.1.1",
65466546
"@types/glob": "^7.2.0",
65476547
"@types/mocha": "^10.0.6",
65486548
"@types/node": "^20.14.2",

Extension/src/LanguageServer/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,10 @@ export class DefaultClient implements Client {
17641764
});
17651765
}
17661766

1767+
if (changedSettings['codeAnalysis.runAutomatically'] !== undefined || changedSettings['codeAnalysis.clangTidy.enabled'] !== undefined) {
1768+
ui.refreshCodeAnalysisText(this.model.isRunningCodeAnalysis.Value);
1769+
}
1770+
17671771
const showButtonSender: string = "settingsChanged";
17681772
if (changedSettings["default.configurationProvider"] !== undefined) {
17691773
void ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.ConfigProvider, showButtonSender);

Extension/src/LanguageServer/configurations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,9 +1574,11 @@ export class CppProperties {
15741574
quoted = true;
15751575
result = result.slice(1, -1);
15761576
}
1577+
// On Windows, isAbsolute does not handle root paths without a slash, such as "C:"
1578+
const isWindowsRootPath: boolean = process.platform === 'win32' && /^[a-zA-Z]:$/.test(result);
15771579
// Make sure all paths result to an absolute path.
15781580
// Do not add the root path to an unresolved env variable.
1579-
if (!result.includes("env:") && !path.isAbsolute(result) && this.rootUri) {
1581+
if (!isWindowsRootPath && !result.includes("env:") && !path.isAbsolute(result) && this.rootUri) {
15801582
result = path.join(this.rootUri.fsPath, result);
15811583
}
15821584
if (quoted) {

Extension/src/LanguageServer/extension.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr
12241224
if (ret?.output === funcStr) {
12251225
ret = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined);
12261226
}
1227-
if (ret !== undefined && ret.succeeded) {
1227+
if (ret !== undefined && ret.succeeded && !ret.output.startsWith("Could not open input file")) {
12281228
funcStr = ret.output;
12291229
funcStr = funcStr.replace(/std::(?:__1|__cxx11)/g, "std"); // simplify std namespaces.
12301230
funcStr = funcStr.replace(/std::basic_/g, "std::");
@@ -1235,7 +1235,11 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr
12351235
}
12361236
}
12371237
if (funcStr.includes("/")) {
1238-
funcStr = "<func>";
1238+
funcStr = "<funcForwardSlash>";
1239+
} else if (funcStr.includes("\\")) {
1240+
funcStr = "<funcBackSlash>";
1241+
} else if (funcStr.includes("@")) {
1242+
funcStr = "<funcAt>";
12391243
} else if (!validFrameFound && (funcStr.startsWith("crash_handler(") || funcStr.startsWith("_sigtramp"))) {
12401244
continue; // Skip these on early frames.
12411245
}
@@ -1246,8 +1250,10 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr
12461250
const offsetPos2: number = offsetPos + offsetStr.length;
12471251
if (isMac) {
12481252
const pendingOffset: string = line.substring(offsetPos2);
1249-
if (!pendingOffset.includes("/")) {
1253+
if (!pendingOffset.includes("/") && !pendingOffset.includes("\\") && !pendingOffset.includes("@")) {
12501254
crashCallStack += pendingOffset;
1255+
} else {
1256+
crashCallStack += "<offsetUnexpectedCharacter>";
12511257
}
12521258
const startAddressPos: number = line.indexOf("0x");
12531259
if (startAddressPos === -1 || startAddressPos >= startPos) {
@@ -1263,8 +1269,10 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr
12631269
continue; // unexpected
12641270
}
12651271
const pendingOffset: string = line.substring(offsetPos2, endPos);
1266-
if (!pendingOffset.includes("/")) {
1272+
if (!pendingOffset.includes("/") && !pendingOffset.includes("\\") && !pendingOffset.includes("@")) {
12671273
crashCallStack += pendingOffset;
1274+
} else {
1275+
crashCallStack += "<offsetUnexpectedCharacter>";
12681276
}
12691277
}
12701278
}
@@ -1285,6 +1293,10 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr
12851293
data = data.substring(0, 8191) + "…";
12861294
}
12871295

1296+
if (addressData.includes("/") || addressData.includes("\\") || addressData.includes("@")) {
1297+
addressData = "<addressDataUnexpectedCharacter>";
1298+
}
1299+
12881300
logCppCrashTelemetry(data, addressData);
12891301

12901302
await util.deleteFile(path.resolve(crashDirectory, crashFile)).catch(logAndReturn.undefined);

Extension/src/LanguageServer/ui.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ export class LanguageStatusUI {
200200
if (this.isParsingWorkspacePaused) {
201201
const displayTwoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
202202
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
203-
+ (displayTwoStatus ? " | " : "")
204-
+ (this.isParsingWorkspace ? this.workspaceParsingPausedText : "");
203+
+ (displayTwoStatus ? " | " : "")
204+
+ (this.isParsingWorkspace ? this.workspaceParsingPausedText : "");
205205
} else {
206206
return this.isParsingWorkspace ? this.workspaceParsingRunningText : this.parsingFilesTooltip;
207207
}
@@ -260,6 +260,13 @@ export class LanguageStatusUI {
260260
};
261261
return item;
262262
}
263+
264+
public refreshCodeAnalysisText(isRunningCodeAnalysis: boolean) {
265+
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
266+
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
267+
this.codeAnalysisStatusItem.text = isRunningCodeAnalysis ? activeText : idleText;
268+
}
269+
263270
private setIsCodeAnalysisPaused(val: boolean): void {
264271
if (!this.isRunningCodeAnalysis) {
265272
return;
@@ -286,9 +293,7 @@ export class LanguageStatusUI {
286293
}
287294
this.isRunningCodeAnalysis = val;
288295
this.codeAnalysisStatusItem.busy = val;
289-
const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText;
290-
const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode();
291-
this.codeAnalysisStatusItem.text = val ? activeText : idleText;
296+
this.refreshCodeAnalysisText(val);
292297
this.codeAnalysisStatusItem.command = val ? {
293298
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
294299
title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"),
@@ -497,7 +502,7 @@ export class LanguageStatusUI {
497502
// TODO: Check some "AlwaysShow" setting here.
498503
this.ShowConfiguration = isCppOrRelated || (util.getWorkspaceIsCpp() &&
499504
(activeEditor.document.fileName.endsWith("tasks.json") ||
500-
activeEditor.document.fileName.endsWith("launch.json")));
505+
activeEditor.document.fileName.endsWith("launch.json")));
501506

502507
if (this.showConfigureIntelliSenseButton) {
503508
if (isCppOrRelated && !!this.currentClient && this.currentClient.getShowConfigureIntelliSenseButton()) {

Extension/tools/OptionsSchema.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,11 @@
477477
"allOf": [
478478
{
479479
"if": {
480-
"properties": { "type": { "const": "scp" } }
480+
"properties": {
481+
"type": {
482+
"const": "scp"
483+
}
484+
}
481485
},
482486
"then": {
483487
"properties": {
@@ -491,7 +495,11 @@
491495
},
492496
{
493497
"if": {
494-
"properties": { "type": { "const": "rsync" } }
498+
"properties": {
499+
"type": {
500+
"const": "rsync"
501+
}
502+
}
495503
},
496504
"then": {
497505
"properties": {
@@ -672,7 +680,7 @@
672680
},
673681
"svdPath": {
674682
"type": "string",
675-
"description": "%c_cpp.debuggers.cppdbg.visualizerFile.description",
683+
"description": "%c_cpp.debuggers.cppdbg.svdPath.description%",
676684
"default": ""
677685
},
678686
"showDisplayString": {

Extension/translations_auto_pr.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const fs = require("fs-extra");
44
const cp = require("child_process");
5-
const Octokit = require('@octokit/rest')
65
const path = require('path');
76
const parseGitConfig = require('parse-git-config');
87

@@ -179,23 +178,21 @@ if (existingUserEmail === undefined) {
179178
cp.execSync(`git config --local user.email "${existingUserEmail}"`);
180179
}
181180

182-
console.log(`pushing to remove branch (git push -f origin ${branchName})`);
181+
console.log(`pushing to remote branch (git push -f origin ${branchName})`);
183182
cp.execSync(`git push -f origin ${branchName}`);
184183

185184
console.log("Checking if there is already a pull request...");
186-
const octokit = new Octokit.Octokit({auth: authToken});
187-
octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
188-
let alreadyHasPullRequest = false;
189-
if (data) {
190-
data.forEach((pr) => {
191-
alreadyHasPullRequest = alreadyHasPullRequest || (pr.title === pullRequestTitle);
192-
});
193-
}
185+
186+
(async function() {
187+
const { Octokit } = await import("@octokit/rest");
188+
const octokit = new Octokit({ auth: authToken });
189+
const { data } = await octokit.pulls.list({ owner: repoOwner, repo: repoName });
190+
let alreadyHasPullRequest = data && data.some(pr => pr.title === pullRequestTitle);
194191

195192
// If not already present, create a PR against our remote branch.
196193
if (!alreadyHasPullRequest) {
197194
console.log("There is not already a pull request. Creating one.");
198-
octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
195+
await octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
199196
} else {
200197
console.log("There is already a pull request.");
201198
}
@@ -212,4 +209,4 @@ octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
212209

213210
console.log(`Remove localization branch (git branch -D localization)`);
214211
cp.execSync('git branch -D localization');
215-
});
212+
})();

0 commit comments

Comments
 (0)