Skip to content

Commit

Permalink
Merge pull request #12633 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.22.0 (2nd time)
  • Loading branch information
sean-mcmanus authored Aug 26, 2024
2 parents 26d0932 + 3dc7067 commit 5d62607
Show file tree
Hide file tree
Showing 23 changed files with 157 additions and 31 deletions.
16 changes: 16 additions & 0 deletions .github/actions/AddComment/AddComment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion .github/actions/AddComment/AddComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../commo
export class AddComment extends ActionBase {
constructor(
private github: GitHub,
private createdAfter: string,
private createdAfter: string | undefined,
private afterDays: number,
labels: string,
private addComment: string,
Expand Down Expand Up @@ -45,6 +45,23 @@ export class AddComment extends ActionBase {
if (hydrated.open && this.validateIssue(hydrated)
// TODO: Verify updated timestamp
) {
// Don't add a comment if already commented on by an action.
let foundActionComment = false;
for await (const commentBatch of issue.getComments()) {
for (const comment of commentBatch) {
if (comment.author.isGitHubApp) {
foundActionComment = true;
break;
}
}
if (foundActionComment)
break;
}
if (foundActionComment) {
safeLog(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
continue;
}

if (this.addComment) {
safeLog(`Posting comment on issue ${hydrated.number}`);
await issue.postComment(this.addComment);
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bug-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug - debugger
on:
schedule:
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
- cron: 50 12 * * * # Run at 12:50 PM UTC (4:50 AM PST, 5:50 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/by-design-closer-debugger .yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: By Design closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 0 13 * * * # Run at 1:00 PM UTC (5:00 AM PST, 6:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enhancement-closer-no-milestone.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Enhancement Closer (no milestone)
on:
schedule:
- cron: 50 11 * * * # Run at 11:50 AM UTC (3:50 AM PST, 4:50 AM PDT)
- cron: 40 12 * * * # Run at 12:40 PM UTC (4:40 AM PST, 5:40 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enhancement-closer-triage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Enhancement Closer (Triage)
on:
schedule:
- cron: 40 11 * * * # Run at 11:40 AM UTC (3:40 AM PST, 4:40 AM PDT)
- cron: 30 12 * * * # Run at 12:30 PM UTC (4:30 AM PST, 5:30 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enhancement-reopener.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Enhancement Reopener
on:
schedule:
- cron: 20 12 * * * # Run at 12:20 PM UTC (4:20 AM PST, 5:20 AM PDT)
- cron: 0 11 * * * # Run at 11:00 AM UTC (3:00 AM PST, 4:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/external-closer-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: External closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 10 13 * * * # Run at 1:10 PM UTC (5:10 AM PST, 6:10 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/feature-request-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature Request - debugger
on:
schedule:
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
- cron: 20 13 * * * # Run at 1:20 PM UTC (5:20 AM PST, 6:20 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/investigate-closer-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Investigate closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 30 13 * * * # Run at 1:30 PM UTC (5:30 AM PST, 6:30 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/investigate-costing-closer-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Investigate Costing closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 40 13 * * * # Run at 1:40 PM UTC (5:40 AM PST, 6:40 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/more-info-needed-closer-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: More Info Needed Closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 50 13 * * * # Run at 1:50 PM UTC (5:50 AM PST, 6:50 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/question-closer-debugger.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Question Closer - debugger
on:
schedule:
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
- cron: 0 14 * * * # Run at 2:00 PM UTC (6:00 AM PST, 7:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
Expand Down
8 changes: 6 additions & 2 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.22.0: August 21, 2024
## Version 1.22.0: August 26, 2024
### Performance Improvements
* 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)
- Performance improvement: Configuration is no longer blocked on tag parsing of all dependent headers.
- 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)
- 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)
* Initialization performance improvements. [#12030](https://github.com/microsoft/vscode-cpptools/issues/12030)
- 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)
- 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)
* Improve the implementation of file buffers to reduce memory usage.

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

## Version 1.21.6: August 5, 2024
* Fix a cpptools-srv crash on shutdown. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
Expand Down
3 changes: 2 additions & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
"scope": "resource"
},
"C_Cpp.inactiveRegionOpacity": {
"type:": "number",
"type": "number",
"default": 0.55,
"markdownDescription": "%c_cpp.configuration.inactiveRegionOpacity.markdownDescription%",
"scope": "resource",
Expand Down Expand Up @@ -1153,6 +1153,7 @@
"scope": "resource"
},
"C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": {
"type": "string",
"enum": [
"newLine",
"sameLine",
Expand Down
7 changes: 6 additions & 1 deletion Extension/src/Debugger/attachToProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,18 @@ export class RemoteAttachPicker {
const args: string[] = [`-ex "target extended-remote ${miDebuggerServerAddress}"`, '-ex "info os processes"', '-batch'];
let processListOutput: util.ProcessReturnType = await util.spawnChildProcess(miDebuggerPath, args);
// The device may not be responsive for a while during the restart after image deploy. Retry 5 times.
for (let i: number = 0; i < 5 && !processListOutput.succeeded; i++) {
for (let i: number = 0; i < 5 && !processListOutput.succeeded && processListOutput.outputError.length === 0; i++) {
processListOutput = await util.spawnChildProcess(miDebuggerPath, args);
}

if (!processListOutput.succeeded) {
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.output));
}

if (processListOutput.outputError.length !== 0) {
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.outputError));
}

const processes: AttachItem[] = this.parseProcessesFromInfoOsProcesses(processListOutput.output);
if (!processes || processes.length === 0) {
throw new Error(localize('failed.to.parse.processes', 'Failed to parse processes: "{0}".', processListOutput.output));
Expand Down
57 changes: 57 additions & 0 deletions Extension/src/LanguageServer/Providers/HoverProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, ResponseError, TextDocumentPositionParams } from 'vscode-languageclient';
import { DefaultClient, HoverRequest } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';

export class HoverProvider implements vscode.HoverProvider {
private client: DefaultClient;
constructor(client: DefaultClient) {
this.client = client;
}

public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.Hover | undefined> {
const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
if (settings.hover === "disabled") {
return undefined;
}
const params: TextDocumentPositionParams = {
textDocument: { uri: document.uri.toString() },
position: Position.create(position.line, position.character)
};
await this.client.ready;
let hoverResult: vscode.Hover;
try {
hoverResult = await this.client.languageClient.sendRequest(HoverRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
// VS Code doesn't like the raw objects returned via RPC, so we need to create proper VS Code objects here.
const strings: vscode.MarkdownString[] = [];
for (const element of hoverResult.contents) {
const oldMarkdownString: vscode.MarkdownString = element as vscode.MarkdownString;
const newMarkdownString: vscode.MarkdownString = new vscode.MarkdownString(oldMarkdownString.value, oldMarkdownString.supportThemeIcons);
newMarkdownString.isTrusted = oldMarkdownString.isTrusted;
newMarkdownString.supportHtml = oldMarkdownString.supportHtml;
newMarkdownString.baseUri = oldMarkdownString.baseUri;
strings.push(newMarkdownString);
}
let range: vscode.Range | undefined;
if (hoverResult.range) {
range = new vscode.Range(hoverResult.range.start.line, hoverResult.range.start.character,
hoverResult.range.end.line, hoverResult.range.end.character);
}

return new vscode.Hover(strings, range);
}
}
16 changes: 15 additions & 1 deletion Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import * as fs from 'fs';
import * as os from 'os';
import { SourceFileConfiguration, SourceFileConfigurationItem, Version, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import { IntelliSenseStatus, Status } from 'vscode-cpptools/out/testApi';
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier, TextDocumentPositionParams } from 'vscode-languageclient';
import { LanguageClient, ServerOptions } from 'vscode-languageclient/node';
import * as nls from 'vscode-nls';
import { DebugConfigurationProvider } from '../Debugger/configurationProvider';
Expand All @@ -43,6 +43,7 @@ import { localizedStringCount, lookupString } from '../nativeStrings';
import { SessionState } from '../sessionState';
import * as telemetry from '../telemetry';
import { TestHook, getTestHook } from '../testHook';
import { HoverProvider } from './Providers/HoverProvider';
import {
CodeAnalysisDiagnosticIdentifiersAndUri,
RegisterCodeAnalysisNotifications,
Expand Down Expand Up @@ -554,6 +555,7 @@ export const GetFoldingRangesRequest: RequestType<GetFoldingRangesParams, GetFol
export const FormatDocumentRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatDocument');
export const FormatRangeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatRange');
export const FormatOnTypeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatOnType');
export const HoverRequest: RequestType<TextDocumentPositionParams, vscode.Hover, void> = new RequestType<TextDocumentPositionParams, vscode.Hover, void>('cpptools/hover');
const CreateDeclarationOrDefinitionRequest: RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void> = new RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void>('cpptools/createDeclDef');
const ExtractToFunctionRequest: RequestType<ExtractToFunctionParams, WorkspaceEditResult, void> = new RequestType<ExtractToFunctionParams, WorkspaceEditResult, void>('cpptools/extractToFunction');
const GoToDirectiveInGroupRequest: RequestType<GoToDirectiveInGroupParams, Position | undefined, void> = new RequestType<GoToDirectiveInGroupParams, Position | undefined, void>('cpptools/goToDirectiveInGroup');
Expand Down Expand Up @@ -1255,6 +1257,7 @@ export class DefaultClient implements Client {
initializedClientCount = 0;
this.inlayHintsProvider = new InlayHintsProvider();

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

// Get diagnostics for configuration provider info.
let configurationLoggingStr: string = "";
Expand Down
Loading

0 comments on commit 5d62607

Please sign in to comment.