Skip to content

Commit 5d62607

Browse files
authored
Merge pull request #12633 from microsoft/main
Merge for 1.22.0 (2nd time)
2 parents 26d0932 + 3dc7067 commit 5d62607

23 files changed

+157
-31
lines changed

.github/actions/AddComment/AddComment.js

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/AddComment/AddComment.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../commo
1010
export class AddComment extends ActionBase {
1111
constructor(
1212
private github: GitHub,
13-
private createdAfter: string,
13+
private createdAfter: string | undefined,
1414
private afterDays: number,
1515
labels: string,
1616
private addComment: string,
@@ -45,6 +45,23 @@ export class AddComment extends ActionBase {
4545
if (hydrated.open && this.validateIssue(hydrated)
4646
// TODO: Verify updated timestamp
4747
) {
48+
// Don't add a comment if already commented on by an action.
49+
let foundActionComment = false;
50+
for await (const commentBatch of issue.getComments()) {
51+
for (const comment of commentBatch) {
52+
if (comment.author.isGitHubApp) {
53+
foundActionComment = true;
54+
break;
55+
}
56+
}
57+
if (foundActionComment)
58+
break;
59+
}
60+
if (foundActionComment) {
61+
safeLog(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
62+
continue;
63+
}
64+
4865
if (this.addComment) {
4966
safeLog(`Posting comment on issue ${hydrated.number}`);
5067
await issue.postComment(this.addComment);

.github/workflows/bug-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Bug - debugger
22
on:
33
schedule:
4-
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
4+
- cron: 50 12 * * * # Run at 12:50 PM UTC (4:50 AM PST, 5:50 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/by-design-closer-debugger .yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: By Design closer - debugger
22
on:
33
schedule:
4-
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
4+
- cron: 0 13 * * * # Run at 1:00 PM UTC (5:00 AM PST, 6:00 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/enhancement-closer-no-milestone.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Enhancement Closer (no milestone)
22
on:
33
schedule:
4-
- cron: 50 11 * * * # Run at 11:50 AM UTC (3:50 AM PST, 4:50 AM PDT)
4+
- cron: 40 12 * * * # Run at 12:40 PM UTC (4:40 AM PST, 5:40 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/enhancement-closer-triage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Enhancement Closer (Triage)
22
on:
33
schedule:
4-
- cron: 40 11 * * * # Run at 11:40 AM UTC (3:40 AM PST, 4:40 AM PDT)
4+
- cron: 30 12 * * * # Run at 12:30 PM UTC (4:30 AM PST, 5:30 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/enhancement-reopener.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Enhancement Reopener
22
on:
33
schedule:
4-
- cron: 20 12 * * * # Run at 12:20 PM UTC (4:20 AM PST, 5:20 AM PDT)
4+
- cron: 0 11 * * * # Run at 11:00 AM UTC (3:00 AM PST, 4:00 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/external-closer-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: External closer - debugger
22
on:
33
schedule:
4-
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
4+
- cron: 10 13 * * * # Run at 1:10 PM UTC (5:10 AM PST, 6:10 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/feature-request-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature Request - debugger
22
on:
33
schedule:
4-
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
4+
- cron: 20 13 * * * # Run at 1:20 PM UTC (5:20 AM PST, 6:20 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/investigate-closer-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Investigate closer - debugger
22
on:
33
schedule:
4-
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
4+
- cron: 30 13 * * * # Run at 1:30 PM UTC (5:30 AM PST, 6:30 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/investigate-costing-closer-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Investigate Costing closer - debugger
22
on:
33
schedule:
4-
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
4+
- cron: 40 13 * * * # Run at 1:40 PM UTC (5:40 AM PST, 6:40 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/more-info-needed-closer-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: More Info Needed Closer - debugger
22
on:
33
schedule:
4-
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
4+
- cron: 50 13 * * * # Run at 1:50 PM UTC (5:50 AM PST, 6:50 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

.github/workflows/question-closer-debugger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Question Closer - debugger
22
on:
33
schedule:
4-
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
4+
- cron: 0 14 * * * # Run at 2:00 PM UTC (6:00 AM PST, 7:00 AM PDT)
55
workflow_dispatch:
66
inputs:
77
readonly:

Extension/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# C/C++ for Visual Studio Code Changelog
22

3-
## Version 1.22.0: August 21, 2024
3+
## Version 1.22.0: August 26, 2024
44
### Performance Improvements
55
* Switch to an alternative implementation of recursive includes (that sends all the paths instead of only the "used" paths). [#11780](https://github.com/microsoft/vscode-cpptools/issues/11780)
66
- Performance improvement: Configuration is no longer blocked on tag parsing of all dependent headers.
7-
- Configuration change: Recursive include paths now always take precedence over system include paths (similar to compiler behavior and non-recursive includes). [#11485](https://github.com/microsoft/vscode-cpptools/issues/11485)
7+
- Configuration change: Recursive include paths now take precedence over system include paths (similar to compiler behavior and non-recursive includes). [#11485](https://github.com/microsoft/vscode-cpptools/issues/11485)
88
* Initialization performance improvements. [#12030](https://github.com/microsoft/vscode-cpptools/issues/12030)
99
- Some processing is parallelized and started earlier (populating the filename cache, discovering files). [#11954](https://github.com/microsoft/vscode-cpptools/issues/11954), [#12169](https://github.com/microsoft/vscode-cpptools/issues/12169)
1010
- Some compiler configuration queries are cached in the database, and processing of compile_commands.json was improved. [#10029](https://github.com/microsoft/vscode-cpptools/issues/10029), [#12078](https://github.com/microsoft/vscode-cpptools/issues/12078)
1111
* Improve the implementation of file buffers to reduce memory usage.
1212

1313
### Enhancements
14+
* Add modified `C_Cpp` settings to the `C/C++: Log Diagnostics` output. [#11700](https://github.com/microsoft/vscode-cpptools/issues/11700)
1415
* Change the default C/C++ `"editor.stickyScroll.defaultModel"` to `"foldingProviderModel"`. [#12483](https://github.com/microsoft/vscode-cpptools/issues/12483)
1516
* Add better validation for settings. [#12371](https://github.com/microsoft/vscode-cpptools/issues/12371)
1617
* Various IntelliSense parsing updates/fixes.
@@ -20,13 +21,16 @@
2021
* Fix an issue where a file is incorrectly processed as C instead of C++. [#12466](https://github.com/microsoft/vscode-cpptools/issues/12466)
2122
* Fix include path ordering being incorrect if there is a duplicate. [#12525](https://github.com/microsoft/vscode-cpptools/issues/12525)
2223
* Fix a WebAssembly "Out of Memory" error. [#12529](https://github.com/microsoft/vscode-cpptools/issues/12529)
24+
* Fix an error message not being shown if the connection failed with remote attach debugging. [#12547](https://github.com/microsoft/vscode-cpptools/issues/12547)
25+
* Thank you for the contribution. [@MrStanislav0 (Stanislav)](https://github.com/MrStanislav0)
2326
* Fix `-I` not being used if `-iquote` is also used for the same path. [#12551](https://github.com/microsoft/vscode-cpptools/issues/12551)
2427
* Fix issues with relative paths on `nvcc` (CUDA) command lines not being handled correctly. [#12553](https://github.com/microsoft/vscode-cpptools/issues/12553)
2528
* Fix a random crash when a child process is created. [#12585](https://github.com/microsoft/vscode-cpptools/issues/12585)
2629
* Fix a crash on shutdown on macOS with a verbose logging level. [#12567](https://github.com/microsoft/vscode-cpptools/issues/12567)
2730
* Fix some issues with recursive includes handling of symbolic links, multi-root, exclusion changes, and file/folder deletion.
2831
* Fix unnecessary IntelliSense resetting when a new file or folder was created.
2932
* Fix accumulation of stale signature help and completion requests.
33+
* Fix some bugs with include completion.
3034

3135
## Version 1.21.6: August 5, 2024
3236
* Fix a cpptools-srv crash on shutdown. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)

Extension/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@
610610
"scope": "resource"
611611
},
612612
"C_Cpp.inactiveRegionOpacity": {
613-
"type:": "number",
613+
"type": "number",
614614
"default": 0.55,
615615
"markdownDescription": "%c_cpp.configuration.inactiveRegionOpacity.markdownDescription%",
616616
"scope": "resource",
@@ -1153,6 +1153,7 @@
11531153
"scope": "resource"
11541154
},
11551155
"C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": {
1156+
"type": "string",
11561157
"enum": [
11571158
"newLine",
11581159
"sameLine",

Extension/src/Debugger/attachToProcess.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,18 @@ export class RemoteAttachPicker {
187187
const args: string[] = [`-ex "target extended-remote ${miDebuggerServerAddress}"`, '-ex "info os processes"', '-batch'];
188188
let processListOutput: util.ProcessReturnType = await util.spawnChildProcess(miDebuggerPath, args);
189189
// The device may not be responsive for a while during the restart after image deploy. Retry 5 times.
190-
for (let i: number = 0; i < 5 && !processListOutput.succeeded; i++) {
190+
for (let i: number = 0; i < 5 && !processListOutput.succeeded && processListOutput.outputError.length === 0; i++) {
191191
processListOutput = await util.spawnChildProcess(miDebuggerPath, args);
192192
}
193193

194194
if (!processListOutput.succeeded) {
195195
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.output));
196196
}
197+
198+
if (processListOutput.outputError.length !== 0) {
199+
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.outputError));
200+
}
201+
197202
const processes: AttachItem[] = this.parseProcessesFromInfoOsProcesses(processListOutput.output);
198203
if (!processes || processes.length === 0) {
199204
throw new Error(localize('failed.to.parse.processes', 'Failed to parse processes: "{0}".', processListOutput.output));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
* See 'LICENSE' in the project root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
import * as vscode from 'vscode';
6+
import { Position, ResponseError, TextDocumentPositionParams } from 'vscode-languageclient';
7+
import { DefaultClient, HoverRequest } from '../client';
8+
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
9+
import { CppSettings } from '../settings';
10+
11+
export class HoverProvider implements vscode.HoverProvider {
12+
private client: DefaultClient;
13+
constructor(client: DefaultClient) {
14+
this.client = client;
15+
}
16+
17+
public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.Hover | undefined> {
18+
const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
19+
if (settings.hover === "disabled") {
20+
return undefined;
21+
}
22+
const params: TextDocumentPositionParams = {
23+
textDocument: { uri: document.uri.toString() },
24+
position: Position.create(position.line, position.character)
25+
};
26+
await this.client.ready;
27+
let hoverResult: vscode.Hover;
28+
try {
29+
hoverResult = await this.client.languageClient.sendRequest(HoverRequest, params, token);
30+
} catch (e: any) {
31+
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
32+
throw new vscode.CancellationError();
33+
}
34+
throw e;
35+
}
36+
if (token.isCancellationRequested) {
37+
throw new vscode.CancellationError();
38+
}
39+
// VS Code doesn't like the raw objects returned via RPC, so we need to create proper VS Code objects here.
40+
const strings: vscode.MarkdownString[] = [];
41+
for (const element of hoverResult.contents) {
42+
const oldMarkdownString: vscode.MarkdownString = element as vscode.MarkdownString;
43+
const newMarkdownString: vscode.MarkdownString = new vscode.MarkdownString(oldMarkdownString.value, oldMarkdownString.supportThemeIcons);
44+
newMarkdownString.isTrusted = oldMarkdownString.isTrusted;
45+
newMarkdownString.supportHtml = oldMarkdownString.supportHtml;
46+
newMarkdownString.baseUri = oldMarkdownString.baseUri;
47+
strings.push(newMarkdownString);
48+
}
49+
let range: vscode.Range | undefined;
50+
if (hoverResult.range) {
51+
range = new vscode.Range(hoverResult.range.start.line, hoverResult.range.start.character,
52+
hoverResult.range.end.line, hoverResult.range.end.character);
53+
}
54+
55+
return new vscode.Hover(strings, range);
56+
}
57+
}

Extension/src/LanguageServer/client.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import * as fs from 'fs';
2727
import * as os from 'os';
2828
import { SourceFileConfiguration, SourceFileConfigurationItem, Version, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
2929
import { IntelliSenseStatus, Status } from 'vscode-cpptools/out/testApi';
30-
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
30+
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier, TextDocumentPositionParams } from 'vscode-languageclient';
3131
import { LanguageClient, ServerOptions } from 'vscode-languageclient/node';
3232
import * as nls from 'vscode-nls';
3333
import { DebugConfigurationProvider } from '../Debugger/configurationProvider';
@@ -43,6 +43,7 @@ import { localizedStringCount, lookupString } from '../nativeStrings';
4343
import { SessionState } from '../sessionState';
4444
import * as telemetry from '../telemetry';
4545
import { TestHook, getTestHook } from '../testHook';
46+
import { HoverProvider } from './Providers/HoverProvider';
4647
import {
4748
CodeAnalysisDiagnosticIdentifiersAndUri,
4849
RegisterCodeAnalysisNotifications,
@@ -554,6 +555,7 @@ export const GetFoldingRangesRequest: RequestType<GetFoldingRangesParams, GetFol
554555
export const FormatDocumentRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatDocument');
555556
export const FormatRangeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatRange');
556557
export const FormatOnTypeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatOnType');
558+
export const HoverRequest: RequestType<TextDocumentPositionParams, vscode.Hover, void> = new RequestType<TextDocumentPositionParams, vscode.Hover, void>('cpptools/hover');
557559
const CreateDeclarationOrDefinitionRequest: RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void> = new RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void>('cpptools/createDeclDef');
558560
const ExtractToFunctionRequest: RequestType<ExtractToFunctionParams, WorkspaceEditResult, void> = new RequestType<ExtractToFunctionParams, WorkspaceEditResult, void>('cpptools/extractToFunction');
559561
const GoToDirectiveInGroupRequest: RequestType<GoToDirectiveInGroupParams, Position | undefined, void> = new RequestType<GoToDirectiveInGroupParams, Position | undefined, void>('cpptools/goToDirectiveInGroup');
@@ -1255,6 +1257,7 @@ export class DefaultClient implements Client {
12551257
initializedClientCount = 0;
12561258
this.inlayHintsProvider = new InlayHintsProvider();
12571259

1260+
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, new HoverProvider(this)));
12581261
this.disposables.push(vscode.languages.registerInlayHintsProvider(util.documentSelector, this.inlayHintsProvider));
12591262
this.disposables.push(vscode.languages.registerRenameProvider(util.documentSelector, new RenameProvider(this)));
12601263
this.disposables.push(vscode.languages.registerReferenceProvider(util.documentSelector, new FindAllReferencesProvider(this)));
@@ -1945,6 +1948,17 @@ export class DefaultClient implements Client {
19451948
if (this.configuration.CurrentConfiguration) {
19461949
configJson = `Current Configuration:\n${JSON.stringify(this.configuration.CurrentConfiguration, null, 4)}\n`;
19471950
}
1951+
const userModifiedSettings = Object.entries(this.settingsTracker.getUserModifiedSettings());
1952+
if (userModifiedSettings.length > 0) {
1953+
const settings: Record<string, any> = {};
1954+
for (const [key] of userModifiedSettings) {
1955+
// Some settings were renamed during a telemetry change, so we need to undo that here.
1956+
const realKey = key.endsWith('2') ? key.slice(0, key.length - 1) : key;
1957+
const fullKey = `C_Cpp.${realKey}`;
1958+
settings[fullKey] = vscode.workspace.getConfiguration("C_Cpp").get(realKey) ?? '<error-retrieving-value>';
1959+
}
1960+
configJson += `Modified Settings:\n${JSON.stringify(settings, null, 4)}\n`;
1961+
}
19481962

19491963
// Get diagnostics for configuration provider info.
19501964
let configurationLoggingStr: string = "";

0 commit comments

Comments
 (0)