diff --git a/.github/actions/AddComment/AddComment.js b/.github/actions/AddComment/AddComment.js index ffcf3a1343..f621a4f7dd 100644 --- a/.github/actions/AddComment/AddComment.js +++ b/.github/actions/AddComment/AddComment.js @@ -31,6 +31,22 @@ class AddComment extends ActionBase_1.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) { + (0, utils_1.safeLog)(`Issue ${hydrated.number} already commented on by an action. Ignoring.`); + continue; + } if (this.addComment) { (0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`); await issue.postComment(this.addComment); diff --git a/.github/actions/AddComment/AddComment.ts b/.github/actions/AddComment/AddComment.ts index e21bf213a3..9dd36e1bb2 100644 --- a/.github/actions/AddComment/AddComment.ts +++ b/.github/actions/AddComment/AddComment.ts @@ -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, @@ -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); diff --git a/.github/workflows/bug-debugger.yml b/.github/workflows/bug-debugger.yml index 294ecfa9de..1a7bee6759 100644 --- a/.github/workflows/bug-debugger.yml +++ b/.github/workflows/bug-debugger.yml @@ -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: diff --git a/.github/workflows/by-design-closer-debugger .yml b/.github/workflows/by-design-closer-debugger .yml index 153c1e9668..35c342ce4e 100644 --- a/.github/workflows/by-design-closer-debugger .yml +++ b/.github/workflows/by-design-closer-debugger .yml @@ -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: diff --git a/.github/workflows/enhancement-closer-no-milestone.yml b/.github/workflows/enhancement-closer-no-milestone.yml index a8b1a89c59..736e91e042 100644 --- a/.github/workflows/enhancement-closer-no-milestone.yml +++ b/.github/workflows/enhancement-closer-no-milestone.yml @@ -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: diff --git a/.github/workflows/enhancement-closer-triage.yml b/.github/workflows/enhancement-closer-triage.yml index 34f02fb074..543bb972f6 100644 --- a/.github/workflows/enhancement-closer-triage.yml +++ b/.github/workflows/enhancement-closer-triage.yml @@ -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: diff --git a/.github/workflows/enhancement-reopener.yml b/.github/workflows/enhancement-reopener.yml index 830823cdad..df3d486f63 100644 --- a/.github/workflows/enhancement-reopener.yml +++ b/.github/workflows/enhancement-reopener.yml @@ -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: diff --git a/.github/workflows/external-closer-debugger.yml b/.github/workflows/external-closer-debugger.yml index 0277b69bfc..55c34cdd47 100644 --- a/.github/workflows/external-closer-debugger.yml +++ b/.github/workflows/external-closer-debugger.yml @@ -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: diff --git a/.github/workflows/feature-request-debugger.yml b/.github/workflows/feature-request-debugger.yml index e80aba06ff..2e3997ea5d 100644 --- a/.github/workflows/feature-request-debugger.yml +++ b/.github/workflows/feature-request-debugger.yml @@ -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: diff --git a/.github/workflows/investigate-closer-debugger.yml b/.github/workflows/investigate-closer-debugger.yml index a13179ce66..ec4c523d7c 100644 --- a/.github/workflows/investigate-closer-debugger.yml +++ b/.github/workflows/investigate-closer-debugger.yml @@ -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: diff --git a/.github/workflows/investigate-costing-closer-debugger.yml b/.github/workflows/investigate-costing-closer-debugger.yml index 4432533ade..0ce6a696bc 100644 --- a/.github/workflows/investigate-costing-closer-debugger.yml +++ b/.github/workflows/investigate-costing-closer-debugger.yml @@ -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: diff --git a/.github/workflows/more-info-needed-closer-debugger.yml b/.github/workflows/more-info-needed-closer-debugger.yml index 0df5ef0902..5085122898 100644 --- a/.github/workflows/more-info-needed-closer-debugger.yml +++ b/.github/workflows/more-info-needed-closer-debugger.yml @@ -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: diff --git a/.github/workflows/question-closer-debugger.yml b/.github/workflows/question-closer-debugger.yml index 7f8ae39ab0..a178134f12 100644 --- a/.github/workflows/question-closer-debugger.yml +++ b/.github/workflows/question-closer-debugger.yml @@ -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: diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index c63f367aad..e2a1359e92 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -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. @@ -20,6 +21,8 @@ * 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) @@ -27,6 +30,7 @@ * 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) diff --git a/Extension/package.json b/Extension/package.json index 957914679f..ba113731e2 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -610,7 +610,7 @@ "scope": "resource" }, "C_Cpp.inactiveRegionOpacity": { - "type:": "number", + "type": "number", "default": 0.55, "markdownDescription": "%c_cpp.configuration.inactiveRegionOpacity.markdownDescription%", "scope": "resource", @@ -1153,6 +1153,7 @@ "scope": "resource" }, "C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": { + "type": "string", "enum": [ "newLine", "sameLine", diff --git a/Extension/src/Debugger/attachToProcess.ts b/Extension/src/Debugger/attachToProcess.ts index 5fddbfc16b..4ff3ce0c2e 100644 --- a/Extension/src/Debugger/attachToProcess.ts +++ b/Extension/src/Debugger/attachToProcess.ts @@ -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)); diff --git a/Extension/src/LanguageServer/Providers/HoverProvider.ts b/Extension/src/LanguageServer/Providers/HoverProvider.ts new file mode 100644 index 0000000000..0a4cd6eab6 --- /dev/null +++ b/Extension/src/LanguageServer/Providers/HoverProvider.ts @@ -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 { + 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); + } +} diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 5a69b496bb..0f3b7d7a9d 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -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'; @@ -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, @@ -554,6 +555,7 @@ export const GetFoldingRangesRequest: RequestType = new RequestType('cpptools/formatDocument'); export const FormatRangeRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); +export const HoverRequest: RequestType = new RequestType('cpptools/hover'); const CreateDeclarationOrDefinitionRequest: RequestType = new RequestType('cpptools/createDeclDef'); const ExtractToFunctionRequest: RequestType = new RequestType('cpptools/extractToFunction'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); @@ -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))); @@ -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 = {}; + 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) ?? ''; + } + configJson += `Modified Settings:\n${JSON.stringify(settings, null, 4)}\n`; + } // Get diagnostics for configuration provider info. let configurationLoggingStr: string = ""; diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 694ad36c35..9c18f85718 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -459,7 +459,7 @@ export class CppSettings extends Settings { public get inlayHintsReferenceOperatorShowSpace(): boolean { return this.getAsBoolean("inlayHints.referenceOperator.showSpace"); } public get isEnhancedColorizationEnabled(): boolean { return this.getAsString("enhancedColorization").toLowerCase() === "enabled" - && this.intelliSenseEngine === "default" + && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get formattingEngine(): string { return this.getAsString("formatting"); } @@ -523,7 +523,7 @@ export class CppSettings extends Settings { public get vcFormatWrapPreserveBlocks(): string { return this.getAsString("vcFormat.wrap.preserveBlocks"); } public get dimInactiveRegions(): boolean { return this.getAsBoolean("dimInactiveRegions") - && this.intelliSenseEngine === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; + && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get sshTargetsView(): string { return this.getAsString("sshTargetsView"); } @@ -894,7 +894,7 @@ export class CppSettings extends Settings { // This is intentionally not async to avoid races due to multiple entrancy. public useVcFormat(document: vscode.TextDocument): boolean { if (this.formattingEngine !== "default") { - return this.formattingEngine === "vcformat"; + return this.formattingEngine.toLowerCase() === "vcformat"; } if (this.clangFormatStyle && this.clangFormatStyle !== "file") { // If a clang-format style other than file is specified, don't try to switch to vcFormat. diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 371a7b3a14..9cad273f50 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -62,17 +62,17 @@ export class SettingsTracker { if (subVal === undefined) { continue; } - if (subVal instanceof Object && !(subVal instanceof Array)) { + if (newRawSetting === undefined && subVal instanceof Object) { collectSettingsRecursive(newKey, subVal, depth + 1); } else { const entry: KeyValuePair | undefined = this.filterAndSanitize(newKey, subVal, correctlyScopedSubSettings, filter); - if (entry && entry.key && entry.value) { + if (entry?.key && entry.value !== undefined) { result[entry.key] = entry.value; } } } }; - if (val instanceof Object && !(val instanceof Array)) { + if (rawSetting === undefined && val instanceof Object) { collectSettingsRecursive(key, val, 1); continue; } @@ -108,6 +108,9 @@ export class SettingsTracker { return ""; } return val; + } else if (val === curSetting["default"]) { + // C_Cpp.default.browse.path is a special case where the default value is null and doesn't match the type definition. + return val; } } } @@ -123,6 +126,9 @@ export class SettingsTracker { if (typeof value === t) { return t; } + if (t === "integer" && typeof value === "number") { + return "number"; + } if (t === "array" && value instanceof Array) { return t; } @@ -131,8 +137,13 @@ export class SettingsTracker { } } } - } else if (typeof type === "string" && typeof value === type) { - return type; + } else if (typeof type === "string") { + if (typeof value === type) { + return type; + } + if (type === "integer" && typeof value === "number") { + return "number"; + } } } return undefined; diff --git a/Extension/src/SSH/sshCommandRunner.ts b/Extension/src/SSH/sshCommandRunner.ts index b9df7f7b80..be60f83db3 100644 --- a/Extension/src/SSH/sshCommandRunner.ts +++ b/Extension/src/SSH/sshCommandRunner.ts @@ -304,7 +304,7 @@ export function runInteractiveSshTerminalCommand(args: ITerminalCommandArgs): Pr // When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line. const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout); - result.resolve({ succeeded: !exitCode, exitCode, output: actualOutput || '' }); + result.resolve({ succeeded: !exitCode, exitCode, outputError: '', output: actualOutput || '' }); }; const failed = (error?: any) => { diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 9bddeba2c0..c962a719cd 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -753,6 +753,7 @@ export interface ProcessReturnType { succeeded: boolean; exitCode?: number | NodeJS.Signals; output: string; + outputError: string; } export async function spawnChildProcess(program: string, args: string[] = [], continueOn?: string, skipLogging?: boolean, cancellationToken?: vscode.CancellationToken): Promise { @@ -766,7 +767,7 @@ export async function spawnChildProcess(program: string, args: string[] = [], co const programOutput: ProcessOutput = await spawnChildProcessImpl(program, args, continueOn, skipLogging, cancellationToken); const exitCode: number | NodeJS.Signals | undefined = programOutput.exitCode; if (programOutput.exitCode) { - return { succeeded: false, exitCode, output: programOutput.stderr || programOutput.stdout || localize('process.exited', 'Process exited with code {0}', exitCode) }; + return { succeeded: false, exitCode, outputError: programOutput.stderr, output: programOutput.stderr || programOutput.stdout || localize('process.exited', 'Process exited with code {0}', exitCode) }; } else { let stdout: string; if (programOutput.stdout.length) { @@ -775,7 +776,7 @@ export async function spawnChildProcess(program: string, args: string[] = [], co } else { stdout = localize('process.succeeded', 'Process executed successfully.'); } - return { succeeded: true, exitCode, output: stdout }; + return { succeeded: true, exitCode, outputError: programOutput.stderr, output: stdout }; } } diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 52cd156c85..8bf2f9c859 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3172,9 +3172,9 @@ merge2@^1.3.0, merge2@^1.4.1: integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^4.0.0, micromatch@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" - integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1"