From d94e87ffeec34d4e8e19a86bab57d2190dfdeeae Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Sat, 26 Apr 2025 15:27:49 -0700 Subject: [PATCH 01/30] WIP - migrate devcmd to cpptools --- Extension/package.json | 20 +++ Extension/package.nls.json | 2 + Extension/src/LanguageServer/devcmd.ts | 176 ++++++++++++++++++++++ Extension/src/LanguageServer/extension.ts | 16 ++ Extension/yarn.lock | 13 ++ 5 files changed, 227 insertions(+) create mode 100644 Extension/src/LanguageServer/devcmd.ts diff --git a/Extension/package.json b/Extension/package.json index ecfc128af..0f760d890 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3703,6 +3703,16 @@ "category": "C/C++", "icon": "$(run)" }, + { + "command": "C_Cpp.SetDevEnvironment", + "title": "%c_cpp.command.SetDevEnvironment.title%", + "category": "C/C++" + }, + { + "command": "C_Cpp.ClearDevEnvironment", + "title": "%c_cpp.command.ClearDevEnvironment.title%", + "category": "C/C++" + }, { "command": "C_Cpp.AddDebugConfiguration", "title": "%c_cpp.command.AddDebugConfiguration.title%", @@ -6145,6 +6155,14 @@ "command": "C_Cpp.BuildAndRunFile", "when": "editorLangId =~ /^(c|(cuda-)?cpp)$/ && config.C_Cpp.debugShortcut && cpptools.buildAndDebug.isSourceFile" }, + { + "command": "C_Cpp.SetDevEnvironment", + "when": "workspacePlatform == windows" + }, + { + "command": "C_Cpp.ClearDevEnvironment", + "when": "workspacePlatform == windows" + }, { "command": "C_Cpp.AddDebugConfiguration", "when": "config.C_Cpp.debugShortcut && cpptools.buildAndDebug.isFolderOpen" @@ -6769,6 +6787,8 @@ "node-fetch": "^2.7.0", "node-loader": "^2.0.0", "node-stream-zip": "^1.15.0", + "node-vcvarsall": "^1.0.1", + "node-vswhere": "^1.0.2", "plist": "^3.1.0", "posix-getopt": "^1.2.1", "shell-quote": "^1.8.1", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index fb4b6ed93..6077d58d6 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -37,6 +37,8 @@ "c_cpp.command.RemoveAllCodeAnalysisProblems.title": "Clear All Code Analysis Problems", "c_cpp.command.BuildAndDebugFile.title": "Debug C/C++ File", "c_cpp.command.BuildAndRunFile.title": "Run C/C++ File", + "c_cpp.command.SetDevEnvironment.title": "Set Developer Environment", + "c_cpp.command.ClearDevEnvironment.title": "Clear Developer Environment", "c_cpp.command.AddDebugConfiguration.title": "Add Debug Configuration", "c_cpp.command.GenerateDoxygenComment.title": "Generate Doxygen Comment", "c_cpp.command.addSshTarget.title": "Add SSH target", diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts new file mode 100644 index 000000000..b7737e877 --- /dev/null +++ b/Extension/src/LanguageServer/devcmd.ts @@ -0,0 +1,176 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All Rights Reserved. + * See 'LICENSE' in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +import { promises as fs } from 'fs'; +import { vcvars } from 'node-vcvarsall'; +import { vswhere } from 'node-vswhere'; +import * as path from 'path'; +import * as vscode from 'vscode'; + +export async function setEnvironment(context?: vscode.ExtensionContext) { + if (!context) { + throw new Error('No context provided'); + } + + const vses = await getVSInstallations(); + if (!vses) { + throw new Error('A Visual Studio installation with the C++ compiler was not found'); + } + + let vs = await chooseVSInstallation(vses); + let options: vcvars.Options | undefined; + if (!vs) { + const compiler = await getAdvancedConfiguration(vses); + vs = compiler.vs; + options = compiler.options; + } + const vars = await vscode.window.withProgress({ + cancellable: false, + location: vscode.ProgressLocation.Notification, + title: 'Configuring Developer Environment...' + }, () => vcvars.getVCVars(vs, options)); + + if (!vars || !vars['INCLUDE']) { + throw new Error(`Something went wrong: ${JSON.stringify(vars)}`); + } + + const host = vars['VSCMD_ARG_HOST_ARCH']; + const target = vars['VSCMD_ARG_TGT_ARCH']; + const arch = vcvars.getArchitecture({ + host: match(host, { 'x86': 'x86', 'x64': 'x64' }) ?? 'x64', + target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64' + }); + const persist = vscode.workspace.getConfiguration('devcmd').get('persistEnvironment') === true; + + context.environmentVariableCollection.clear(); + for (const key of Object.keys(vars)) { + context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); + } + context.environmentVariableCollection.description = (arch ? `${arch} ` : '') + 'Developer Command Prompt for ' + vs.displayName; + context.environmentVariableCollection.persistent = persist; + return true; +} + +async function getVSInstallations() { + const installations = await vswhere.getVSInstallations({ + all: true, + prerelease: true, + sort: true, + requires: ['Microsoft.VisualStudio.Component.VC.Tools.x86.x64'] + }); + + if (installations.length === 0) { + throw new Error('A Visual Studio installation with the C++ compiler was not found'); + } + return installations; +} + +async function chooseVSInstallation(installations: vswhere.Installation[]): Promise { + const items: vscode.QuickPickItem[] = installations.map(installation => { + label: installation.displayName, + description: `Default settings for ${installation.displayName}` + }); + items.push({ + label: 'Advanced options...', + description: 'Select a specific host/target architecture, toolset version, etc.' + }); + const selection = await vscode.window.showQuickPick(items, { + placeHolder: 'Select a Visual Studio installation' + }); + if (!selection) { + throw new Error('The operation was cancelled'); + } + + return installations.find(installation => installation.displayName === selection.label); +} + +async function getAdvancedConfiguration(vses: vswhere.Installation[]): Promise { + const compiler = await chooseCompiler(vses); + if (!compiler) { + throw new Error('The operation was cancelled'); + } + await setOptions(compiler); + return compiler; +} + +interface Compiler { + version: string; + vs: vswhere.Installation; + options: vcvars.Options; +} + +async function chooseCompiler(vses: vswhere.Installation[]): Promise { + const compilers: Compiler[] = []; + for (const vs of vses) { + const vcPath = path.join(vs.installationPath, 'VC', 'Tools', 'MSVC'); + const folders = await fs.readdir(vcPath); + for (const version of folders) { + const options: vcvars.Options = { + // Don't set the version in the options if there is only one + vcVersion: folders.length > 1 ? version : undefined + }; + compilers.push({ version, vs, options }); + } + } + const items = compilers.map(compiler => { + label: compiler.version, + description: compiler.vs.displayName + }); + const selection = await vscode.window.showQuickPick(items, { + placeHolder: 'Select a toolset version' + }); + if (!selection) { + throw new Error('The operation was cancelled'); + } + return compilers.find(compiler => compiler.version === selection.label && compiler.vs.displayName === selection.description); +} + +async function setOptions(compiler: Compiler): Promise { + const vcPath = path.join(compiler.vs.installationPath, 'VC', 'Tools', 'MSVC', compiler.version, 'bin'); + const hostTargets = await getHostsAndTargets(vcPath); + if (hostTargets.length > 1) { + const items = hostTargets.map(ht => { + label: vcvars.getArchitecture(ht), + description: `host = ${ht.host}, target = ${ht.target}` + }); + const selection = await vscode.window.showQuickPick(items, { + placeHolder: 'Select a host and target architecture' + }); + if (!selection) { + throw new Error('The operation was cancelled'); + } + compiler.options.arch = selection.label; + } +} + +async function getHostsAndTargets(vcPath: string): Promise { + const hosts = await fs.readdir(vcPath); + if (hosts.length === 0) { + throw new Error('No hosts found'); + } + const hostTargets: vcvars.HostTarget[] = []; + for (const host of hosts) { + const h = match<'x86' | 'x64' | undefined>(host.toLowerCase(), { 'hostx86': 'x86', 'hostx64': 'x64' }); + if (!h) { + // skip any arm/arm64 folders because there is no arm compiler + continue; + } + const targets = await fs.readdir(path.join(vcPath, host)); + for (const target of targets) { + hostTargets.push({ + host: h, + target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64' + }); + } + } + return hostTargets; +} + +export function deactivate() { +} + +function match(item: string, cases: { [key: string]: T }): T | undefined { + return cases[item]; +} diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 6db23d4a6..6d2145005 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -29,6 +29,7 @@ import { CodeActionDiagnosticInfo, CodeAnalysisDiagnosticIdentifiersAndUri, code import { registerRelatedFilesProvider } from './copilotProviders'; import { CppBuildTaskProvider } from './cppBuildTaskProvider'; import { getCustomConfigProviders } from './customProviders'; +import { setEnvironment } from './devcmd'; import { getLanguageConfig } from './languageConfig'; import { CppConfigurationLanguageModelTool } from './lmTool'; import { getLocaleId } from './localization'; @@ -431,6 +432,8 @@ export async function registerCommands(enabled: boolean): Promise { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? () => onSetDevEnvironment() : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? () => onClearDevEnvironment() : onDisabledCommand)); } function onDisabledCommand() { @@ -1550,3 +1553,16 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho return true; } + +async function onSetDevEnvironment(): Promise { + try { + await setEnvironment(util.extensionContext); + void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); + } catch (error: any) { + void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`); + } +} + +async function onClearDevEnvironment(): Promise { + util.extensionContext?.environmentVariableCollection.clear(); +} diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 41a964ea5..f355dcf81 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3559,6 +3559,19 @@ node-stream-zip@^1.15.0: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea" integrity sha1-FYrbiO2ABMbEmjlrUKal3jvKM+o= +node-vcvarsall@^1.0.1: + version "1.0.1" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.0.1.tgz#d7ee885e4ca41f0f0d814e3a277995cc95ff20b0" + integrity sha1-1+6IXkykHw8NgU46J3mVzJX/ILA= + dependencies: + node-vswhere "^1.0.2" + tmp "^0.2.1" + +node-vswhere@^1.0.2: + version "1.0.2" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vswhere/-/node-vswhere-1.0.2.tgz#f6cac2bd288042f0ab4ee7904e534e04d2f55d2c" + integrity sha1-9srCvSiAQvCrTueQTlNOBNL1XSw= + normalize-path@3.0.0, normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" From 7f2ea2a2ca57c597e9809646cba7dedf40af62dd Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 29 Apr 2025 20:20:55 -0700 Subject: [PATCH 02/30] Update walkthrough and make runAndDebug work --- Extension/package.json | 6 ++++ Extension/package.nls.json | 9 ++--- .../src/Debugger/configurationProvider.ts | 36 ++++++++++++++----- .../LanguageServer/cppBuildTaskProvider.ts | 19 +++++++++- Extension/src/LanguageServer/devcmd.ts | 10 ++++-- Extension/src/LanguageServer/extension.ts | 2 ++ Extension/src/LanguageServer/settings.ts | 1 + Extension/src/common.ts | 5 ++- .../open-developer-command-prompt.md | 12 +++++-- .../install-compiler-windows.md | 5 +-- .../install-compiler-windows10.md | 5 +-- .../install-compiler-windows11.md | 5 +-- 12 files changed, 84 insertions(+), 31 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 0f760d890..d173287e8 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3538,6 +3538,12 @@ "default": "default", "markdownDescription": "%c_cpp.configuration.windowsErrorReportingMode.markdownDescription%", "scope": "window" + }, + "C_Cpp.persistDevEnvironment": { + "type": "boolean", + "default": true, + "markdownDescription": "%c_cpp.configuration.persistDevEnvironment.markdownDescription%", + "scope": "resource" } } } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 6077d58d6..d00885eb5 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -851,6 +851,7 @@ ] }, "c_cpp.configuration.debugShortcut.description": "Show the \"Run and Debug\" play button and \"Add Debug Configuration\" gear in the editor title bar for C++ files.", + "c_cpp.configuration.persistDevEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", "c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).", "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.", "c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", @@ -1061,15 +1062,15 @@ }, "c_cpp.walkthrough.create.cpp.file.altText": "Open a C++ file or a folder with a C++ project.", "c_cpp.walkthrough.command.prompt.title": { - "message": "Launch from the Developer Command Prompt for VS", + "message": "Apply the Visual Studio Developer Environment", "comment": [ - "{Locked=\"Developer Command Prompt for VS\"}" + "{Locked=\"Visual Studio\"}" ] }, "c_cpp.walkthrough.command.prompt.description": { - "message": "When using the Microsoft Visual Studio C++ compiler, the C++ extension requires you to launch VS Code from the Developer Command Prompt for VS. Follow the instructions on the right to relaunch.\n[Reload Window](command:workbench.action.reloadWindow)", + "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetDevEnvironment?%22walkthrough%22)", "comment": [ - "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"VS Code\"} {Locked=\"Developer Command Prompt for VS\"} {Locked=\"\n[\"} {Locked=\"](command:workbench.action.reloadWindow)\"}" + "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetDevEnvironment?%22walkthrough%22)\"}" ] }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index f4f874501..c90c2916f 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -121,7 +121,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv } if (this.isClConfiguration(selection.label)) { - this.showErrorIfClNotAvailable(selection.label); + await this.showErrorIfClNotAvailable(selection.label); } return [selection.configuration]; @@ -582,12 +582,32 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return configurationLabel.startsWith("C/C++: cl.exe"); } - private showErrorIfClNotAvailable(_configurationLabel: string): boolean { - if (!process.env.DevEnvDir || process.env.DevEnvDir.length === 0) { - void vscode.window.showErrorMessage(localize({ - key: "cl.exe.not.available", - comment: ["{0} is a command option in a menu. {1} is the product name \"Developer Command Prompt for VS\"."] - }, "{0} is only usable when VS Code is run from the {1}.", `cl.exe ${this.buildAndDebugActiveFileStr()}`, "Developer Command Prompt for VS")); + /** + * @returns `true` if the Developer Environment is not available and an error was shown to the user, `false` if the Developer Environment is available or the user chose to apply it. + */ + private async showErrorIfClNotAvailable(_configurationLabel: string): Promise { + if (!util.hasMsvcEnvironment()) { + const applyDevEnv = localize("apply.dev.env", "Apply Developer Environment"); + const cancel = localize("cancel", "Cancel"); + const response = await vscode.window.showErrorMessage( + localize({ + key: "cl.exe.not.available", + comment: ["{0} is a command option in a menu."] + }, "{0} requires the Visual Studio Developer Environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), + applyDevEnv, + cancel); + if (response === applyDevEnv) { + try { + await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment'); + } catch { + // Ignore the error, the user will be prompted to apply the environment manually. + } + } + if (util.hasMsvcEnvironment()) { + return false; + } + void vscode.window.showErrorMessage( + localize('dev.env.not.applied', 'The Visual Studio Developer Environment was not applied. Please try again or run VS Code from the Developer Command Prompt for VS.')); return true; } return false; @@ -967,7 +987,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv placeHolder: items.length === 0 ? localize("no.compiler.found", "No compiler found") : localize("select.debug.configuration", "Select a debug configuration") }); } - if (selection && this.isClConfiguration(selection.configuration.name) && this.showErrorIfClNotAvailable(selection.configuration.name)) { + if (selection && this.isClConfiguration(selection.configuration.name) && await this.showErrorIfClNotAvailable(selection.configuration.name)) { return; } return selection?.configuration; diff --git a/Extension/src/LanguageServer/cppBuildTaskProvider.ts b/Extension/src/LanguageServer/cppBuildTaskProvider.ts index 33227c14e..3002965dd 100644 --- a/Extension/src/LanguageServer/cppBuildTaskProvider.ts +++ b/Extension/src/LanguageServer/cppBuildTaskProvider.ts @@ -6,12 +6,13 @@ import * as cp from "child_process"; import * as os from 'os'; import * as path from 'path'; -import { CustomExecution, Disposable, Event, EventEmitter, ProcessExecution, Pseudoterminal, ShellExecution, Task, TaskDefinition, TaskEndEvent, TaskExecution, TaskGroup, TaskProvider, tasks, TaskScope, TerminalDimensions, TextEditor, window, workspace, WorkspaceFolder } from 'vscode'; +import { CustomExecution, Disposable, EnvironmentVariableMutator, Event, EventEmitter, ProcessExecution, Pseudoterminal, ShellExecution, Task, TaskDefinition, TaskEndEvent, TaskExecution, TaskGroup, TaskProvider, tasks, TaskScope, TerminalDimensions, TextEditor, window, workspace, WorkspaceFolder } from 'vscode'; import * as nls from 'vscode-nls'; import * as util from '../common'; import * as telemetry from '../telemetry'; import { Client } from './client'; import * as configs from './configurations'; +import { isEnvironmentOverrideApplied } from "./devcmd"; import * as ext from './extension'; import { OtherSettings } from './settings'; @@ -430,6 +431,22 @@ class CustomBuildTaskTerminal implements Pseudoterminal { } } + if (isEnvironmentOverrideApplied(util.extensionContext)) { + // If the user has applied the Developer Environment to this workspace, it should apply to all newly opened terminals. + // However, this does not apply to processes that we spawn ourselves in the Pseudoterminal, so we need to specify the + // correct environment in order to emulate the terminal behavior properly. + const env = { ...process.env }; + util.extensionContext?.environmentVariableCollection.forEach((variable: string, mutator: EnvironmentVariableMutator) => { + if (variable.toLowerCase() === "path") { + // Path is special because it has a placeholder to insert the current Path into. + env[variable] = util.resolveVariables(mutator.value); + } else { + env[variable] = mutator.value; + } + }); + this.options.env = env; + } + const splitWriteEmitter = (lines: string | Buffer) => { const splitLines: string[] = lines.toString().split(/\r?\n/g); for (let i: number = 0; i < splitLines.length; i++) { diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index b7737e877..0a066a4c3 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -8,6 +8,11 @@ import { vcvars } from 'node-vcvarsall'; import { vswhere } from 'node-vswhere'; import * as path from 'path'; import * as vscode from 'vscode'; +import { CppSettings } from './settings'; + +export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) { + return context?.environmentVariableCollection.get('VCToolsInstallDir') !== undefined; +} export async function setEnvironment(context?: vscode.ExtensionContext) { if (!context) { @@ -42,14 +47,15 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { host: match(host, { 'x86': 'x86', 'x64': 'x64' }) ?? 'x64', target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64' }); - const persist = vscode.workspace.getConfiguration('devcmd').get('persistEnvironment') === true; + const settings = new CppSettings(vscode.workspace.workspaceFolders?.at(0)?.uri); context.environmentVariableCollection.clear(); for (const key of Object.keys(vars)) { context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); } context.environmentVariableCollection.description = (arch ? `${arch} ` : '') + 'Developer Command Prompt for ' + vs.displayName; - context.environmentVariableCollection.persistent = persist; + context.environmentVariableCollection.persistent = settings.persistDevEnvironment; + return true; } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 6d2145005..41d2ae5b2 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1557,6 +1557,7 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho async function onSetDevEnvironment(): Promise { try { await setEnvironment(util.extensionContext); + await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); } catch (error: any) { void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`); @@ -1565,4 +1566,5 @@ async function onSetDevEnvironment(): Promise { async function onClearDevEnvironment(): Promise { util.extensionContext?.environmentVariableCollection.clear(); + await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 6e199cd64..eb4b8afa9 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -551,6 +551,7 @@ export class CppSettings extends Settings { && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get sshTargetsView(): string { return this.getAsString("sshTargetsView"); } + public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistDevEnvironment"); } // Returns the value of a setting as a string with proper type validation and checks for valid enum values while returning an undefined value if necessary. private getAsStringOrUndefined(settingName: string): string | undefined { diff --git a/Extension/src/common.ts b/Extension/src/common.ts index e726669a6..4123de009 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -1565,7 +1565,10 @@ export function hasMsvcEnvironment(): boolean { 'WindowsSDKLibVersion', 'WindowsSDKVersion' ]; - return msvcEnvVars.every((envVarName) => process.env[envVarName] !== undefined && process.env[envVarName] !== ''); + return msvcEnvVars.every(envVarName => + (process.env[envVarName] !== undefined && process.env[envVarName] !== '') || + extensionContext?.environmentVariableCollection?.get(envVarName) !== undefined + ); } function isIntegral(str: string): boolean { diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index e8af0926f..107af4360 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,7 +1,13 @@

Relaunch using the Developer Command Prompt for VS

-

You are using a Windows machine with the MSVC compiler, so you need to start VS Code from the Developer Command Prompt for VS for all environment variables to be set correctly. To relaunch using the Developer Command Prompt for VS:

+

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

    -
  1. Open the Developer Command Prompt for VS by typing "developer" in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

    +
  2. Start VS Code from the Developer Command Prompt for VS.

  3. +

    - or -

    +
  4. Run the C/C++: Set Developer Environment command.

    +
+

To relaunch using the Developer Command Prompt for VS

+
    +
  1. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

  2. -
  3. Type "code" into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

    +
  4. Type code into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

  5. diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows.md b/Extension/walkthrough/installcompiler/install-compiler-windows.md index 81cdda541..4da07bd3b 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows.md @@ -8,11 +8,8 @@

    Note: You can use the C++ toolset from Visual Studio Build Tools along with Visual Studio Code to compile, build, and verify any C++ codebase as long as you also have a valid Visual Studio license (either Community, Pro, or Enterprise) that you are actively using to develop that C++ codebase.

    -
  6. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  7. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu.

  8. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -
    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    -
\ No newline at end of file diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows10.md b/Extension/walkthrough/installcompiler/install-compiler-windows10.md index 5ae6ebadd..7e215fd65 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows10.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows10.md @@ -11,12 +11,9 @@

Verifying the compiler installation

    -
  1. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  2. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu.

  3. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -
    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    -

Other compiler options

diff --git a/Extension/walkthrough/installcompiler/install-compiler-windows11.md b/Extension/walkthrough/installcompiler/install-compiler-windows11.md index ae48333f6..cf9c39f1b 100644 --- a/Extension/walkthrough/installcompiler/install-compiler-windows11.md +++ b/Extension/walkthrough/installcompiler/install-compiler-windows11.md @@ -11,12 +11,9 @@

Verifying the compiler installation

    -
  1. Open the Developer Command Prompt for VS by typing 'developer' in the Windows Start menu.

    +
  2. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu.

  3. Check your MSVC installation by typing cl into the Developer Command Prompt for VS. You should see a copyright message with the version and basic usage description.

    -
    -

    Note: To use MSVC from the command line or VS Code, you must run from a Developer Command Prompt for VS. An ordinary shell such as PowerShell, Bash, or the Windows command prompt does not have the necessary path environment variables set.

    -

Other compiler options

From 2f02eb2a36dba9325fd33a4ac297a7aab45cbe73 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 29 Apr 2025 20:46:40 -0700 Subject: [PATCH 03/30] localize --- Extension/src/LanguageServer/devcmd.ts | 57 ++++++++++++++++++-------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index 0a066a4c3..9e8507bcc 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -8,20 +8,41 @@ import { vcvars } from 'node-vcvarsall'; import { vswhere } from 'node-vswhere'; import * as path from 'path'; import * as vscode from 'vscode'; +import * as nls from 'vscode-nls'; +import { isWindows } from '../constants'; import { CppSettings } from './settings'; +nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); +const localize: nls.LocalizeFunc = nls.loadMessageBundle(); + +const ERROR_NO_CONTEXT = localize('no.context.provided', 'No context provided'); +const NOT_WINDOWS = localize('not.windows', 'This command is only available on Windows'); +const ERROR_NO_VS_FOUND = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); +const ERROR_OPERATION_CANCELLED = localize('operation.cancelled', 'The operation was cancelled'); +const ERROR_NO_HOSTS_FOUND = localize('no.hosts', 'No hosts found'); +const CONFIGURING_DEV_ENV = localize('config.dev.env', 'Configuring Developer Environment...'); +const SELECT_VS_INSTALLATION = localize('select.vs.install', 'Select a Visual Studio installation'); +const ADVANCED_OPTIONS = localize('advanced.options', 'Advanced options...'); +const ADVANCED_OPTIONS_DESCRIPTION = localize('advanced.options.desc', 'Select a specific host/target architecture, toolset version, etc.'); +const SELECT_TOOLSET_VERSION = localize('select.toolset', 'Select a toolset version'); +const SELECT_HOST_TARGET_ARCH = localize('select.host.target', 'Select a host and target architecture'); + export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) { return context?.environmentVariableCollection.get('VCToolsInstallDir') !== undefined; } export async function setEnvironment(context?: vscode.ExtensionContext) { + if (!isWindows) { + throw new Error(NOT_WINDOWS); + } + if (!context) { - throw new Error('No context provided'); + throw new Error(ERROR_NO_CONTEXT); } const vses = await getVSInstallations(); if (!vses) { - throw new Error('A Visual Studio installation with the C++ compiler was not found'); + throw new Error(ERROR_NO_VS_FOUND); } let vs = await chooseVSInstallation(vses); @@ -34,11 +55,11 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { const vars = await vscode.window.withProgress({ cancellable: false, location: vscode.ProgressLocation.Notification, - title: 'Configuring Developer Environment...' + title: CONFIGURING_DEV_ENV }, () => vcvars.getVCVars(vs, options)); if (!vars || !vars['INCLUDE']) { - throw new Error(`Something went wrong: ${JSON.stringify(vars)}`); + throw new Error(localize('something.wrong', 'Something went wrong: {0}', JSON.stringify(vars))); } const host = vars['VSCMD_ARG_HOST_ARCH']; @@ -53,7 +74,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { for (const key of Object.keys(vars)) { context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); } - context.environmentVariableCollection.description = (arch ? `${arch} ` : '') + 'Developer Command Prompt for ' + vs.displayName; + context.environmentVariableCollection.description = localize('dev.env.for', '{0} Developer Environment for {1}', arch, vs.displayName); context.environmentVariableCollection.persistent = settings.persistDevEnvironment; return true; @@ -68,7 +89,7 @@ async function getVSInstallations() { }); if (installations.length === 0) { - throw new Error('A Visual Studio installation with the C++ compiler was not found'); + throw new Error(ERROR_NO_VS_FOUND); } return installations; } @@ -76,17 +97,17 @@ async function getVSInstallations() { async function chooseVSInstallation(installations: vswhere.Installation[]): Promise { const items: vscode.QuickPickItem[] = installations.map(installation => { label: installation.displayName, - description: `Default settings for ${installation.displayName}` + description: localize('default.settings', 'Default settings for {0}', installation.displayName) }); items.push({ - label: 'Advanced options...', - description: 'Select a specific host/target architecture, toolset version, etc.' + label: ADVANCED_OPTIONS, + description: ADVANCED_OPTIONS_DESCRIPTION }); const selection = await vscode.window.showQuickPick(items, { - placeHolder: 'Select a Visual Studio installation' + placeHolder: SELECT_VS_INSTALLATION }); if (!selection) { - throw new Error('The operation was cancelled'); + throw new Error(ERROR_OPERATION_CANCELLED); } return installations.find(installation => installation.displayName === selection.label); @@ -95,7 +116,7 @@ async function chooseVSInstallation(installations: vswhere.Installation[]): Prom async function getAdvancedConfiguration(vses: vswhere.Installation[]): Promise { const compiler = await chooseCompiler(vses); if (!compiler) { - throw new Error('The operation was cancelled'); + throw new Error(ERROR_OPERATION_CANCELLED); } await setOptions(compiler); return compiler; @@ -125,10 +146,10 @@ async function chooseCompiler(vses: vswhere.Installation[]): Promise compiler.version === selection.label && compiler.vs.displayName === selection.description); } @@ -139,13 +160,13 @@ async function setOptions(compiler: Compiler): Promise { if (hostTargets.length > 1) { const items = hostTargets.map(ht => { label: vcvars.getArchitecture(ht), - description: `host = ${ht.host}, target = ${ht.target}` + description: localize('host.target', 'host = {0}, target = {1}', ht.host, ht.target) }); const selection = await vscode.window.showQuickPick(items, { - placeHolder: 'Select a host and target architecture' + placeHolder: SELECT_HOST_TARGET_ARCH }); if (!selection) { - throw new Error('The operation was cancelled'); + throw new Error(ERROR_OPERATION_CANCELLED); } compiler.options.arch = selection.label; } @@ -154,7 +175,7 @@ async function setOptions(compiler: Compiler): Promise { async function getHostsAndTargets(vcPath: string): Promise { const hosts = await fs.readdir(vcPath); if (hosts.length === 0) { - throw new Error('No hosts found'); + throw new Error(ERROR_NO_HOSTS_FOUND); } const hostTargets: vcvars.HostTarget[] = []; for (const host of hosts) { From 074aef324006d9d2dee223e110e49f088072da38 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 29 Apr 2025 20:47:09 -0700 Subject: [PATCH 04/30] rename variable --- Extension/src/LanguageServer/devcmd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index 9e8507bcc..1041d5eca 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -16,7 +16,7 @@ nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFo const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const ERROR_NO_CONTEXT = localize('no.context.provided', 'No context provided'); -const NOT_WINDOWS = localize('not.windows', 'This command is only available on Windows'); +const ERROR_NOT_WINDOWS = localize('not.windows', 'This command is only available on Windows'); const ERROR_NO_VS_FOUND = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); const ERROR_OPERATION_CANCELLED = localize('operation.cancelled', 'The operation was cancelled'); const ERROR_NO_HOSTS_FOUND = localize('no.hosts', 'No hosts found'); @@ -33,7 +33,7 @@ export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) export async function setEnvironment(context?: vscode.ExtensionContext) { if (!isWindows) { - throw new Error(NOT_WINDOWS); + throw new Error(ERROR_NOT_WINDOWS); } if (!context) { From fe5e59fb1bbf57625db393ae2dc33436f6dd92ef Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 29 Apr 2025 21:47:04 -0700 Subject: [PATCH 05/30] Reset translations for string without args to fix gulp task --- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md.i18n.json | 2 +- .../open-developer-command-prompt.md | 14 ++++++++------ 14 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 50da12c2c..81e415704 100644 --- a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新启动", - "walkthrough.windows.background.dev.command.prompt": " 你使用的是具有 MSVC 编译器的 Windows 计算机,因此需要从 {0} 启动 VS Code,以正确设置所有环境变量。要使用 {1} 重新启动,请:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "通过在 Windows“开始”菜单中键入“{1}”打开 {0}。选择 {2} 将自动导航到当前打开的文件夹。", "walkthrough.windows.press.f5": "在命令提示符中键入“{0}”,然后按 Enter。此操作应会重新启动 VS Code 并将你带回此演练。" } \ No newline at end of file diff --git a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index b23a8e0f0..c53630609 100644 --- a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新啟動", - "walkthrough.windows.background.dev.command.prompt": " 您正使用 Windows 電腦搭配 MSVC 編譯器,因此您必須從 {0} 啟動 VS Code,以便正確設定所有環境變數。若要使用 {1} 以下重新啟動:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "在 Windows [開始] 功能表中輸入 \"{1}\",以開啟 {0}。選取 {2},這會自動瀏覽至您目前開啟的資料夾。", "walkthrough.windows.press.f5": "在命令提示字元中輸入 \"{0}\",然後按 Enter。這應該會重新啟動 VS Code,並帶您回到此逐步解說。" } \ No newline at end of file diff --git a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 60a0d692e..093203d8c 100644 --- a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Znovu spustit pomocí {0}", - "walkthrough.windows.background.dev.command.prompt": " Používáte počítač s Windows s kompilátorem MVSC, takže musíte spustit VS Code z {0}, aby se všechny proměnné prostředí správně nastavily. Opětovné spuštění pomocí nástroje {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Otevřete {0} zadáním „{1}“ v nabídce Start ve Windows. Vyberte {2}, čímž automaticky přejdete do aktuální otevřené složky.", "walkthrough.windows.press.f5": "Do příkazového řádku zadejte „{0}“ a stiskněte Enter. Mělo by se znovu spustit VS Code a vrátit se k tomuto názorném postupu. " } \ No newline at end of file diff --git a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 03d07cc30..771cb72eb 100644 --- a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Mit dem {0} neu starten", - "walkthrough.windows.background.dev.command.prompt": " Sie verwenden einen Windows-Computer mit dem MSVC-Compiler. Daher müssen Sie VS Code aus dem {0} starten, damit alle Umgebungsvariablen ordnungsgemäß festgelegt werden. So initiieren Sie den Neustart mithilfe von {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben. Wählen Sie {2} aus, das Sie automatisch zu Ihrem aktuell geöffneten Ordner navigiert.", "walkthrough.windows.press.f5": "Geben Sie „{0}“ in die Eingabeaufforderung ein, und drücken Sie die EINGABETASTE. Dies sollte VS Code neu starten und Sie zu dieser exemplarischen Vorgehensweise zurückkehren. " } \ No newline at end of file diff --git a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 9bad7c7ea..8ae6da32f 100644 --- a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Volver a iniciar con el {0}", - "walkthrough.windows.background.dev.command.prompt": " Está usando una máquina Windows con el compilador de MSVC, por lo que debe iniciar VS Code desde el {0} para que todas las variables de entorno se establezcan correctamente. Para volver a iniciar con el {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows. Selecciona el {2}, que irá automáticamente a la carpeta abierta actual.", "walkthrough.windows.press.f5": "Escriba '{0}' en el símbolo del sistema y pulse Entrar. Esto debería reiniciar VS Code y hacerte volver a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 9c3cf0391..51f7824da 100644 --- a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Relancer à l’aide du {0}", - "walkthrough.windows.background.dev.command.prompt": " Vous utilisez une machine Windows avec le compilateur MSVC. Vous devez donc démarrer VS Code à partir de l’{0} pour que toutes les variables d’environnement soient correctement définies. Pour relancer en tirant parti de l’{1} :", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows. Sélectionnez le {2}, qui accède automatiquement à votre dossier ouvert actuel.", "walkthrough.windows.press.f5": "Tapez « {0} » dans l’invite de commandes et appuyez sur Entrée. Vous devriez relancer VS Code et revenir à cette procédure pas à pas. " } \ No newline at end of file diff --git a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index d0ad50441..500f071d6 100644 --- a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Riavvia utilizzando il {0}", - "walkthrough.windows.background.dev.command.prompt": " Si sta usando un computer Windows con il compilatore MSVC, quindi è necessario avviare VS Code da {0} per impostare correttamente tutte le variabili di ambiente. Per riavviare usando {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Aprire il {0} digitando \"{1}\" nel menu Start di Windows. Selezionare il {2}, che passerà automaticamente alla cartella aperta corrente.", "walkthrough.windows.press.f5": "Digitare \"{0}\" nel prompt dei comandi e premere INVIO. È consigliabile riavviare VS Code e tornare a questa procedura dettagliata. " } \ No newline at end of file diff --git a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 8068620ed..225ed7046 100644 --- a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "{0} を使用して再起動する", - "walkthrough.windows.background.dev.command.prompt": " MSVC コンパイラで Windows マシンを使用しているため、すべての環境変数を正しく設定するには、{0} から VS Code を開始する必要があります。{1} を使用して再起動するには:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows スタート メニューで \"{1}\" と入力して、{0} を開きます。{2} を選択すると、現在開いているフォルダーに自動的に移動します。", "walkthrough.windows.press.f5": "コマンド プロンプトに \"{0}\" と入力して Enter キーを押します。これにより、VS Code が再起動され、このチュートリアルに戻ります。" } \ No newline at end of file diff --git a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index b87e3d4ad..1f2ce6eaf 100644 --- a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "{0}을(를) 사용하여 다시 시작", - "walkthrough.windows.background.dev.command.prompt": " MSVC 컴파일러와 함께 Windows 컴퓨터를 사용하고 있으므로 모든 환경 변수를 올바르게 설정하려면 {0}에서 VS Code를 시작해야 합니다. {1}을(를) 사용하여 다시 시작하려면 다음을 수행하세요.", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows 시작 메뉴에 \"{1}\"을(를) 입력하여 {0}을(를) 엽니다. {2}을(를) 선택하면 현재 열려 있는 폴더로 자동으로 이동합니다.", "walkthrough.windows.press.f5": "명령 프롬프트에 \"{0}\"을(를) 입력하고 Enter 키를 누릅니다. 이렇게 하면 VS Code가 다시 시작되고 이 연습으로 다시 돌아옵니다. " } \ No newline at end of file diff --git a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index d7cf404d3..f81ace39c 100644 --- a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Uruchom ponownie przy użyciu {0}", - "walkthrough.windows.background.dev.command.prompt": " Używasz komputera z systemem Windows i kompilatorem programu Microsoft Visual C++ z {0}, więc musisz uruchomić program VS Code od początku, aby wszystkie zmienne środowiskowe zostały poprawnie ustawione. Aby ponownie uruchomić przy użyciu {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows. Wybierz {2}, który automatycznie przeniesie do bieżącego otwartego folderu.", "walkthrough.windows.press.f5": "Wpisz „{0}” w wierszu polecenia i naciśnij klawisz Enter. To powinno ponownie uruchomić program VS Code i przenieść Cię z powrotem do tego przewodnika. " } \ No newline at end of file diff --git a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 4a188415a..df1e5073d 100644 --- a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Reiniciar usando o {0}", - "walkthrough.windows.background.dev.command.prompt": " Você está usando um computador Windows com o compilador do MSVC, portanto, é necessário iniciar o VS Code a partir do {0} para que todas as variáveis de ambiente sejam definidas corretamente. Para reiniciar usando o {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Abra o {0} digitando \"{1}\" no menu Iniciar do Windows. Selecione o {2}, que navegará automaticamente para a pasta atualmente aberta.", "walkthrough.windows.press.f5": "Digite \"{0}\" na solicitação de comando e pressione enter. Isso deve relançar o VS Code e levá-lo de volta a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 6e672957d..8d7cde572 100644 --- a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Перезапустить с помощью {0}", - "walkthrough.windows.background.dev.command.prompt": " Вы используете компьютер Windows с компилятором MSVC, поэтому вам необходимо запустить VS Code из {0}, чтобы все переменные среды были установлены правильно. Для перезапуска с помощью {1}:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows. Выберите {2}. Вы автоматически перейдете к текущей открытой папке.", "walkthrough.windows.press.f5": "Введите \"{0}\" в командную строку и нажмите ВВОД. Это должно перезапустить VS Code и вернуть вас к этому пошаговому руководству. " } \ No newline at end of file diff --git a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 9159abf1b..226d5e2d8 100644 --- a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Sayfayı kullanarak yeniden {0}", - "walkthrough.windows.background.dev.command.prompt": " MSVC derleyicili bir Windows makinesi kullanıyorsunuz, dolayısıyla tüm ortam değişkenlerinin doğru ayarlanması için {0} öğesinden VS Code'u başlatmanız gerekiyor. {1} kullanarak yeniden başlatmak için:", + "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows Başlat menüsüne “{1}” yazarak {0} öğesini açın. Mevcut açık klasörünüze otomatik olarak gidecek olan {2} öğesini seçin.", "walkthrough.windows.press.f5": "Komut istemine \"{0}\" yazın ve enter tuşuna basın. Bu, VS Code'u yeniden başlatmalı ve sizi bu izlenecek yola geri götürmelidir. " } \ No newline at end of file diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index 107af4360..683ee21dd 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,13 +1,15 @@

Relaunch using the Developer Command Prompt for VS

-

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

-
    -
  1. Start VS Code from the Developer Command Prompt for VS.

  2. -

    - or -

    -
  3. Run the C/C++: Set Developer Environment command.

    -
+

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

+
    +
  • Start VS Code from the Developer Command Prompt for VS, or

    +
  • +
  • Run the C/C++: Set Developer Environment command.

    +
  • +

To relaunch using the Developer Command Prompt for VS

  1. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

  2. Type code into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

  3. +
\ No newline at end of file From 896085088cf36c8f52fa23068154ac5fd8f6d071 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 12:00:56 -0700 Subject: [PATCH 06/30] delete the strings instead --- .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md.i18n.json | 1 - 13 files changed, 13 deletions(-) diff --git a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 81e415704..0e68d62fe 100644 --- a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新启动", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "通过在 Windows“开始”菜单中键入“{1}”打开 {0}。选择 {2} 将自动导航到当前打开的文件夹。", "walkthrough.windows.press.f5": "在命令提示符中键入“{0}”,然后按 Enter。此操作应会重新启动 VS Code 并将你带回此演练。" } \ No newline at end of file diff --git a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index c53630609..4c04eefee 100644 --- a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新啟動", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "在 Windows [開始] 功能表中輸入 \"{1}\",以開啟 {0}。選取 {2},這會自動瀏覽至您目前開啟的資料夾。", "walkthrough.windows.press.f5": "在命令提示字元中輸入 \"{0}\",然後按 Enter。這應該會重新啟動 VS Code,並帶您回到此逐步解說。" } \ No newline at end of file diff --git a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 093203d8c..39ddcb8e3 100644 --- a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Znovu spustit pomocí {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Otevřete {0} zadáním „{1}“ v nabídce Start ve Windows. Vyberte {2}, čímž automaticky přejdete do aktuální otevřené složky.", "walkthrough.windows.press.f5": "Do příkazového řádku zadejte „{0}“ a stiskněte Enter. Mělo by se znovu spustit VS Code a vrátit se k tomuto názorném postupu. " } \ No newline at end of file diff --git a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 771cb72eb..33180a556 100644 --- a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Mit dem {0} neu starten", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben. Wählen Sie {2} aus, das Sie automatisch zu Ihrem aktuell geöffneten Ordner navigiert.", "walkthrough.windows.press.f5": "Geben Sie „{0}“ in die Eingabeaufforderung ein, und drücken Sie die EINGABETASTE. Dies sollte VS Code neu starten und Sie zu dieser exemplarischen Vorgehensweise zurückkehren. " } \ No newline at end of file diff --git a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 8ae6da32f..98b13f51f 100644 --- a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Volver a iniciar con el {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows. Selecciona el {2}, que irá automáticamente a la carpeta abierta actual.", "walkthrough.windows.press.f5": "Escriba '{0}' en el símbolo del sistema y pulse Entrar. Esto debería reiniciar VS Code y hacerte volver a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 51f7824da..37a4c1c6e 100644 --- a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Relancer à l’aide du {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows. Sélectionnez le {2}, qui accède automatiquement à votre dossier ouvert actuel.", "walkthrough.windows.press.f5": "Tapez « {0} » dans l’invite de commandes et appuyez sur Entrée. Vous devriez relancer VS Code et revenir à cette procédure pas à pas. " } \ No newline at end of file diff --git a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 500f071d6..e39f05c55 100644 --- a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Riavvia utilizzando il {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Aprire il {0} digitando \"{1}\" nel menu Start di Windows. Selezionare il {2}, che passerà automaticamente alla cartella aperta corrente.", "walkthrough.windows.press.f5": "Digitare \"{0}\" nel prompt dei comandi e premere INVIO. È consigliabile riavviare VS Code e tornare a questa procedura dettagliata. " } \ No newline at end of file diff --git a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 225ed7046..be03f5950 100644 --- a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "{0} を使用して再起動する", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows スタート メニューで \"{1}\" と入力して、{0} を開きます。{2} を選択すると、現在開いているフォルダーに自動的に移動します。", "walkthrough.windows.press.f5": "コマンド プロンプトに \"{0}\" と入力して Enter キーを押します。これにより、VS Code が再起動され、このチュートリアルに戻ります。" } \ No newline at end of file diff --git a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 1f2ce6eaf..d6bb46d8b 100644 --- a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "{0}을(를) 사용하여 다시 시작", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows 시작 메뉴에 \"{1}\"을(를) 입력하여 {0}을(를) 엽니다. {2}을(를) 선택하면 현재 열려 있는 폴더로 자동으로 이동합니다.", "walkthrough.windows.press.f5": "명령 프롬프트에 \"{0}\"을(를) 입력하고 Enter 키를 누릅니다. 이렇게 하면 VS Code가 다시 시작되고 이 연습으로 다시 돌아옵니다. " } \ No newline at end of file diff --git a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index f81ace39c..cee9103aa 100644 --- a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Uruchom ponownie przy użyciu {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows. Wybierz {2}, który automatycznie przeniesie do bieżącego otwartego folderu.", "walkthrough.windows.press.f5": "Wpisz „{0}” w wierszu polecenia i naciśnij klawisz Enter. To powinno ponownie uruchomić program VS Code i przenieść Cię z powrotem do tego przewodnika. " } \ No newline at end of file diff --git a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index df1e5073d..ea8325260 100644 --- a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Reiniciar usando o {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Abra o {0} digitando \"{1}\" no menu Iniciar do Windows. Selecione o {2}, que navegará automaticamente para a pasta atualmente aberta.", "walkthrough.windows.press.f5": "Digite \"{0}\" na solicitação de comando e pressione enter. Isso deve relançar o VS Code e levá-lo de volta a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 8d7cde572..6623b6dc6 100644 --- a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Перезапустить с помощью {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows. Выберите {2}. Вы автоматически перейдете к текущей открытой папке.", "walkthrough.windows.press.f5": "Введите \"{0}\" в командную строку и нажмите ВВОД. Это должно перезапустить VS Code и вернуть вас к этому пошаговому руководству. " } \ No newline at end of file diff --git a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 226d5e2d8..1b3368b21 100644 --- a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -5,7 +5,6 @@ // Do not edit this file. It is machine generated. { "walkthrough.windows.title.open.dev.command.prompt": "Sayfayı kullanarak yeniden {0}", - "walkthrough.windows.background.dev.command.prompt": "You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:", "walkthrough.open.command.prompt": "Windows Başlat menüsüne “{1}” yazarak {0} öğesini açın. Mevcut açık klasörünüze otomatik olarak gidecek olan {2} öğesini seçin.", "walkthrough.windows.press.f5": "Komut istemine \"{0}\" yazın ve enter tuşuna basın. Bu, VS Code'u yeniden başlatmalı ve sizi bu izlenecek yola geri götürmelidir. " } \ No newline at end of file From 10ea32a878b67ae45425e8d4d64b1904270e9525 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 12:16:49 -0700 Subject: [PATCH 07/30] add telemetry --- Extension/src/LanguageServer/extension.ts | 9 ++++++--- .../devcommandprompt/open-developer-command-prompt.md | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 41d2ae5b2..187b35d3f 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -432,8 +432,8 @@ export async function registerCommands(enabled: boolean): Promise { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? () => onSetDevEnvironment() : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? () => onClearDevEnvironment() : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? onSetDevEnvironment : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? onClearDevEnvironment : onDisabledCommand)); } function onDisabledCommand() { @@ -1554,14 +1554,17 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho return true; } -async function onSetDevEnvironment(): Promise { +async function onSetDevEnvironment(sender?: any): Promise { + let success: boolean = true; try { await setEnvironment(util.extensionContext); await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); } catch (error: any) { + success = false; void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`); } + telemetry.logLanguageServerEvent("SetDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() }); } async function onClearDevEnvironment(): Promise { diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index 683ee21dd..d2f88709a 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,9 +1,9 @@

Relaunch using the Developer Command Prompt for VS

-

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

+

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

  • Start VS Code from the Developer Command Prompt for VS, or

  • -
  • Run the C/C++: Set Developer Environment command.

    +
  • Run the C/C++: Set Developer Environment command.

To relaunch using the Developer Command Prompt for VS

From ce6fd1e23f04ebbb47bb34d45c301b477e53277a Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 12:32:21 -0700 Subject: [PATCH 08/30] add a test for Windows --- .../tests/devEnvironment.test.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts diff --git a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts new file mode 100644 index 000000000..2adcbfcff --- /dev/null +++ b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts @@ -0,0 +1,26 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All Rights Reserved. + * See 'LICENSE' in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +import { equal } from 'assert'; +import { suite } from 'mocha'; +import * as vscode from 'vscode'; +import * as util from '../../../../src/common'; +import { isWindows } from "../../../../src/constants"; + +suite("set developer environment", () => { + if (isWindows) { + test("set developer environment (Windows)", async () => { + const promise = vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'test'); + const timer = setInterval(() => { + void vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); + }, 1000); + await promise; + clearInterval(timer); + equal(util.hasMsvcEnvironment(), true, "MSVC environment not set correctly."); + }); + } else { + test("set developer environment (Linux/macOS)", () => { + }); + } +}); From 638275c15a3e0c35f97392a519d7139771bfeda8 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 15:32:32 -0700 Subject: [PATCH 09/30] Additional walkthrough tuning --- .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../open-developer-command-prompt.md.i18n.json | 1 - .../devcommandprompt/open-developer-command-prompt.md | 10 +++++----- 14 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 0e68d62fe..4f654052a 100644 --- a/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新启动", "walkthrough.open.command.prompt": "通过在 Windows“开始”菜单中键入“{1}”打开 {0}。选择 {2} 将自动导航到当前打开的文件夹。", "walkthrough.windows.press.f5": "在命令提示符中键入“{0}”,然后按 Enter。此操作应会重新启动 VS Code 并将你带回此演练。" } \ No newline at end of file diff --git a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 4c04eefee..27d110bdf 100644 --- a/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "使用 {0} 重新啟動", "walkthrough.open.command.prompt": "在 Windows [開始] 功能表中輸入 \"{1}\",以開啟 {0}。選取 {2},這會自動瀏覽至您目前開啟的資料夾。", "walkthrough.windows.press.f5": "在命令提示字元中輸入 \"{0}\",然後按 Enter。這應該會重新啟動 VS Code,並帶您回到此逐步解說。" } \ No newline at end of file diff --git a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 39ddcb8e3..6620c4386 100644 --- a/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Znovu spustit pomocí {0}", "walkthrough.open.command.prompt": "Otevřete {0} zadáním „{1}“ v nabídce Start ve Windows. Vyberte {2}, čímž automaticky přejdete do aktuální otevřené složky.", "walkthrough.windows.press.f5": "Do příkazového řádku zadejte „{0}“ a stiskněte Enter. Mělo by se znovu spustit VS Code a vrátit se k tomuto názorném postupu. " } \ No newline at end of file diff --git a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 33180a556..ae200631a 100644 --- a/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Mit dem {0} neu starten", "walkthrough.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben. Wählen Sie {2} aus, das Sie automatisch zu Ihrem aktuell geöffneten Ordner navigiert.", "walkthrough.windows.press.f5": "Geben Sie „{0}“ in die Eingabeaufforderung ein, und drücken Sie die EINGABETASTE. Dies sollte VS Code neu starten und Sie zu dieser exemplarischen Vorgehensweise zurückkehren. " } \ No newline at end of file diff --git a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 98b13f51f..fdb0e1947 100644 --- a/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Volver a iniciar con el {0}", "walkthrough.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows. Selecciona el {2}, que irá automáticamente a la carpeta abierta actual.", "walkthrough.windows.press.f5": "Escriba '{0}' en el símbolo del sistema y pulse Entrar. Esto debería reiniciar VS Code y hacerte volver a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 37a4c1c6e..9e7f1b479 100644 --- a/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Relancer à l’aide du {0}", "walkthrough.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows. Sélectionnez le {2}, qui accède automatiquement à votre dossier ouvert actuel.", "walkthrough.windows.press.f5": "Tapez « {0} » dans l’invite de commandes et appuyez sur Entrée. Vous devriez relancer VS Code et revenir à cette procédure pas à pas. " } \ No newline at end of file diff --git a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index e39f05c55..92cf22cdc 100644 --- a/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Riavvia utilizzando il {0}", "walkthrough.open.command.prompt": "Aprire il {0} digitando \"{1}\" nel menu Start di Windows. Selezionare il {2}, che passerà automaticamente alla cartella aperta corrente.", "walkthrough.windows.press.f5": "Digitare \"{0}\" nel prompt dei comandi e premere INVIO. È consigliabile riavviare VS Code e tornare a questa procedura dettagliata. " } \ No newline at end of file diff --git a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index be03f5950..ce5a01e7c 100644 --- a/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "{0} を使用して再起動する", "walkthrough.open.command.prompt": "Windows スタート メニューで \"{1}\" と入力して、{0} を開きます。{2} を選択すると、現在開いているフォルダーに自動的に移動します。", "walkthrough.windows.press.f5": "コマンド プロンプトに \"{0}\" と入力して Enter キーを押します。これにより、VS Code が再起動され、このチュートリアルに戻ります。" } \ No newline at end of file diff --git a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index d6bb46d8b..3972b8e4a 100644 --- a/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "{0}을(를) 사용하여 다시 시작", "walkthrough.open.command.prompt": "Windows 시작 메뉴에 \"{1}\"을(를) 입력하여 {0}을(를) 엽니다. {2}을(를) 선택하면 현재 열려 있는 폴더로 자동으로 이동합니다.", "walkthrough.windows.press.f5": "명령 프롬프트에 \"{0}\"을(를) 입력하고 Enter 키를 누릅니다. 이렇게 하면 VS Code가 다시 시작되고 이 연습으로 다시 돌아옵니다. " } \ No newline at end of file diff --git a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index cee9103aa..a1672f55b 100644 --- a/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Uruchom ponownie przy użyciu {0}", "walkthrough.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows. Wybierz {2}, który automatycznie przeniesie do bieżącego otwartego folderu.", "walkthrough.windows.press.f5": "Wpisz „{0}” w wierszu polecenia i naciśnij klawisz Enter. To powinno ponownie uruchomić program VS Code i przenieść Cię z powrotem do tego przewodnika. " } \ No newline at end of file diff --git a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index ea8325260..469b3e384 100644 --- a/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Reiniciar usando o {0}", "walkthrough.open.command.prompt": "Abra o {0} digitando \"{1}\" no menu Iniciar do Windows. Selecione o {2}, que navegará automaticamente para a pasta atualmente aberta.", "walkthrough.windows.press.f5": "Digite \"{0}\" na solicitação de comando e pressione enter. Isso deve relançar o VS Code e levá-lo de volta a este tutorial. " } \ No newline at end of file diff --git a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 6623b6dc6..c785ebd83 100644 --- a/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Перезапустить с помощью {0}", "walkthrough.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows. Выберите {2}. Вы автоматически перейдете к текущей открытой папке.", "walkthrough.windows.press.f5": "Введите \"{0}\" в командную строку и нажмите ВВОД. Это должно перезапустить VS Code и вернуть вас к этому пошаговому руководству. " } \ No newline at end of file diff --git a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json index 1b3368b21..7fd65d7a1 100644 --- a/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/devcommandprompt/open-developer-command-prompt.md.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "walkthrough.windows.title.open.dev.command.prompt": "Sayfayı kullanarak yeniden {0}", "walkthrough.open.command.prompt": "Windows Başlat menüsüne “{1}” yazarak {0} öğesini açın. Mevcut açık klasörünüze otomatik olarak gidecek olan {2} öğesini seçin.", "walkthrough.windows.press.f5": "Komut istemine \"{0}\" yazın ve enter tuşuna basın. Bu, VS Code'u yeniden başlatmalı ve sizi bu izlenecek yola geri götürmelidir. " } \ No newline at end of file diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index d2f88709a..52e7f6bab 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,15 +1,15 @@ -

Relaunch using the Developer Command Prompt for VS

-

You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:

+

Apply the Visual Studio Developer Environment

+

The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied:

    -
  • Start VS Code from the Developer Command Prompt for VS, or

    +
  • Start VS Code from the Developer Command Prompt for VS

  • Run the C/C++: Set Developer Environment command.

-

To relaunch using the Developer Command Prompt for VS

+

To relaunch VS Code using the Developer Command Prompt for VS

  1. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

  2. -
  3. Type code into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

    +
  4. Type code into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

\ No newline at end of file From 988bebfe47a77a0faf33831cf6bf3e5d710391e8 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 12:51:25 -0700 Subject: [PATCH 10/30] test for linux/mac --- Extension/src/LanguageServer/extension.ts | 5 ++++- .../SimpleCppProject/tests/devEnvironment.test.ts | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 187b35d3f..7a3de0082 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -17,7 +17,7 @@ import { TargetPopulation } from 'vscode-tas-client'; import * as which from 'which'; import { logAndReturn } from '../Utility/Async/returns'; import * as util from '../common'; -import { modelSelector } from '../constants'; +import { isWindows, modelSelector } from '../constants'; import { instrument } from '../instrumentation'; import { getCrashCallStacksChannel } from '../logger'; import { PlatformInformation } from '../platform'; @@ -1562,6 +1562,9 @@ async function onSetDevEnvironment(sender?: any): Promise { void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); } catch (error: any) { success = false; + if (!isWindows) { + throw error; + } void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`); } telemetry.logLanguageServerEvent("SetDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() }); diff --git a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts index 2adcbfcff..95e2d0926 100644 --- a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts +++ b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts @@ -20,7 +20,15 @@ suite("set developer environment", () => { equal(util.hasMsvcEnvironment(), true, "MSVC environment not set correctly."); }); } else { - test("set developer environment (Linux/macOS)", () => { + test("set developer environment (Linux/macOS)", async () => { + try { + await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'test'); + equal(false, true, "Should not be able to set developer environment on non-Windows platform."); + } + catch (e) { + equal((e as Error).message, 'This command is only available on Windows', "Should throw error when trying to set developer environment on non-Windows platform."); + } + equal(util.hasMsvcEnvironment(), false, "MSVC environment should not be set on non-Windows platforms."); }); } }); From 495af54aca9ce336ee383ed6a7c98afac89a81a0 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 15:35:31 -0700 Subject: [PATCH 11/30] fix the setting scope --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index d173287e8..6520298b5 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3543,7 +3543,7 @@ "type": "boolean", "default": true, "markdownDescription": "%c_cpp.configuration.persistDevEnvironment.markdownDescription%", - "scope": "resource" + "scope": "window" } } } From 5c6fe91e8dffc6777daa857aa18f0dc1bf60d562 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 15:40:36 -0700 Subject: [PATCH 12/30] telemetry for build and debug --- Extension/src/Debugger/configurationProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index c90c2916f..13d46e7c2 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -598,7 +598,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv cancel); if (response === applyDevEnv) { try { - await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment'); + await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'buildAndDebug'); } catch { // Ignore the error, the user will be prompted to apply the environment manually. } From faa03d72935816ebaf1615bb97e7ab3cb5aae8dd Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 16:05:23 -0700 Subject: [PATCH 13/30] cleanup in devcmd.ts --- Extension/src/LanguageServer/devcmd.ts | 67 ++++++++++++-------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index 1041d5eca..896eae215 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -15,17 +15,17 @@ import { CppSettings } from './settings'; nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); const localize: nls.LocalizeFunc = nls.loadMessageBundle(); -const ERROR_NO_CONTEXT = localize('no.context.provided', 'No context provided'); -const ERROR_NOT_WINDOWS = localize('not.windows', 'This command is only available on Windows'); -const ERROR_NO_VS_FOUND = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); -const ERROR_OPERATION_CANCELLED = localize('operation.cancelled', 'The operation was cancelled'); -const ERROR_NO_HOSTS_FOUND = localize('no.hosts', 'No hosts found'); -const CONFIGURING_DEV_ENV = localize('config.dev.env', 'Configuring Developer Environment...'); -const SELECT_VS_INSTALLATION = localize('select.vs.install', 'Select a Visual Studio installation'); -const ADVANCED_OPTIONS = localize('advanced.options', 'Advanced options...'); -const ADVANCED_OPTIONS_DESCRIPTION = localize('advanced.options.desc', 'Select a specific host/target architecture, toolset version, etc.'); -const SELECT_TOOLSET_VERSION = localize('select.toolset', 'Select a toolset version'); -const SELECT_HOST_TARGET_ARCH = localize('select.host.target', 'Select a host and target architecture'); +const errorNoContext = localize('no.context.provided', 'No context provided'); +const errorNotWindows = localize('not.windows', 'This command is only available on Windows'); +const errorNoVSFound = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); +const errorOperationCancelled = localize('operation.cancelled', 'The operation was cancelled'); +const errorNoHostsFound = localize('no.hosts', 'No hosts found'); +const configuringDevEnv = localize('config.dev.env', 'Configuring Developer Environment...'); +const selectVSInstallation = localize('select.vs.install', 'Select a Visual Studio installation'); +const advancedOptions = localize('advanced.options', 'Advanced options...'); +const advancedOptionsDescription = localize('advanced.options.desc', 'Select a specific host/target architecture, toolset version, etc.'); +const selectToolsetVersion = localize('select.toolset', 'Select a toolset version'); +const selectHostTargetArch = localize('select.host.target', 'Select a host and target architecture'); export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) { return context?.environmentVariableCollection.get('VCToolsInstallDir') !== undefined; @@ -33,16 +33,16 @@ export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) export async function setEnvironment(context?: vscode.ExtensionContext) { if (!isWindows) { - throw new Error(ERROR_NOT_WINDOWS); + throw new Error(errorNotWindows); } if (!context) { - throw new Error(ERROR_NO_CONTEXT); + throw new Error(errorNoContext); } const vses = await getVSInstallations(); if (!vses) { - throw new Error(ERROR_NO_VS_FOUND); + throw new Error(errorNoVSFound); } let vs = await chooseVSInstallation(vses); @@ -55,7 +55,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { const vars = await vscode.window.withProgress({ cancellable: false, location: vscode.ProgressLocation.Notification, - title: CONFIGURING_DEV_ENV + title: configuringDevEnv }, () => vcvars.getVCVars(vs, options)); if (!vars || !vars['INCLUDE']) { @@ -89,7 +89,7 @@ async function getVSInstallations() { }); if (installations.length === 0) { - throw new Error(ERROR_NO_VS_FOUND); + throw new Error(errorNoVSFound); } return installations; } @@ -100,34 +100,34 @@ async function chooseVSInstallation(installations: vswhere.Installation[]): Prom description: localize('default.settings', 'Default settings for {0}', installation.displayName) }); items.push({ - label: ADVANCED_OPTIONS, - description: ADVANCED_OPTIONS_DESCRIPTION + label: advancedOptions, + description: advancedOptionsDescription }); const selection = await vscode.window.showQuickPick(items, { - placeHolder: SELECT_VS_INSTALLATION + placeHolder: selectVSInstallation }); if (!selection) { - throw new Error(ERROR_OPERATION_CANCELLED); + throw new Error(errorOperationCancelled); } return installations.find(installation => installation.displayName === selection.label); } +interface Compiler { + version: string; + vs: vswhere.Installation; + options: vcvars.Options; +} + async function getAdvancedConfiguration(vses: vswhere.Installation[]): Promise { const compiler = await chooseCompiler(vses); if (!compiler) { - throw new Error(ERROR_OPERATION_CANCELLED); + throw new Error(errorOperationCancelled); } await setOptions(compiler); return compiler; } -interface Compiler { - version: string; - vs: vswhere.Installation; - options: vcvars.Options; -} - async function chooseCompiler(vses: vswhere.Installation[]): Promise { const compilers: Compiler[] = []; for (const vs of vses) { @@ -146,10 +146,10 @@ async function chooseCompiler(vses: vswhere.Installation[]): Promise compiler.version === selection.label && compiler.vs.displayName === selection.description); } @@ -163,10 +163,10 @@ async function setOptions(compiler: Compiler): Promise { description: localize('host.target', 'host = {0}, target = {1}', ht.host, ht.target) }); const selection = await vscode.window.showQuickPick(items, { - placeHolder: SELECT_HOST_TARGET_ARCH + placeHolder: selectHostTargetArch }); if (!selection) { - throw new Error(ERROR_OPERATION_CANCELLED); + throw new Error(errorOperationCancelled); } compiler.options.arch = selection.label; } @@ -175,7 +175,7 @@ async function setOptions(compiler: Compiler): Promise { async function getHostsAndTargets(vcPath: string): Promise { const hosts = await fs.readdir(vcPath); if (hosts.length === 0) { - throw new Error(ERROR_NO_HOSTS_FOUND); + throw new Error(errorNoHostsFound); } const hostTargets: vcvars.HostTarget[] = []; for (const host of hosts) { @@ -195,9 +195,6 @@ async function getHostsAndTargets(vcPath: string): Promise return hostTargets; } -export function deactivate() { -} - function match(item: string, cases: { [key: string]: T }): T | undefined { return cases[item]; } From f5afa97c9dc6895f838a18fff9217b10b7be2dfd Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 30 Apr 2025 16:35:29 -0700 Subject: [PATCH 14/30] one more update to the walkthrough text --- .../devcommandprompt/open-developer-command-prompt.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index 52e7f6bab..ea5187dd0 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,5 +1,5 @@

Apply the Visual Studio Developer Environment

-

The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied:

+

The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied. You only need to do one of the following:

  • Start VS Code from the Developer Command Prompt for VS

  • @@ -8,8 +8,10 @@

To relaunch VS Code using the Developer Command Prompt for VS

    -
  1. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu. Select the Developer Command Prompt for VS, which will automatically navigate to your current open folder.

    +
  2. Close the current instance of VS Code

  3. -
  4. Type code into the command prompt and hit enter. This should relaunch VS Code and take you back to this walkthrough.

    +
  5. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu then select the Developer Command Prompt for VS.

    +
  6. +
  7. Type code into the command prompt and hit enter. This should relaunch VS Code in the same workspace and take you back to this walkthrough.

\ No newline at end of file From f10bfa6fd6d520b317a5dd93f9b9638adef7234a Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Thu, 1 May 2025 11:59:33 -0700 Subject: [PATCH 15/30] PR feedback --- Extension/package.json | 16 +++--- Extension/package.nls.json | 10 ++-- .../src/Debugger/configurationProvider.ts | 50 +++++++++++-------- Extension/src/LanguageServer/devcmd.ts | 30 ++++++++--- Extension/src/LanguageServer/extension.ts | 20 +++++--- Extension/src/LanguageServer/settings.ts | 2 +- .../tests/devEnvironment.test.ts | 7 +-- 7 files changed, 80 insertions(+), 55 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 6520298b5..7c9dea79e 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3539,10 +3539,10 @@ "markdownDescription": "%c_cpp.configuration.windowsErrorReportingMode.markdownDescription%", "scope": "window" }, - "C_Cpp.persistDevEnvironment": { + "C_Cpp.persistVSDeveloperEnvironment": { "type": "boolean", "default": true, - "markdownDescription": "%c_cpp.configuration.persistDevEnvironment.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.persistVSDeveloperEnvironment.markdownDescription%", "scope": "window" } } @@ -3710,13 +3710,13 @@ "icon": "$(run)" }, { - "command": "C_Cpp.SetDevEnvironment", - "title": "%c_cpp.command.SetDevEnvironment.title%", + "command": "C_Cpp.SetVSDevEnvironment", + "title": "%c_cpp.command.SetVSDevEnvironment.title%", "category": "C/C++" }, { - "command": "C_Cpp.ClearDevEnvironment", - "title": "%c_cpp.command.ClearDevEnvironment.title%", + "command": "C_Cpp.ClearVSDevEnvironment", + "title": "%c_cpp.command.ClearVSDevEnvironment.title%", "category": "C/C++" }, { @@ -6162,11 +6162,11 @@ "when": "editorLangId =~ /^(c|(cuda-)?cpp)$/ && config.C_Cpp.debugShortcut && cpptools.buildAndDebug.isSourceFile" }, { - "command": "C_Cpp.SetDevEnvironment", + "command": "C_Cpp.SetVSDevEnvironment", "when": "workspacePlatform == windows" }, { - "command": "C_Cpp.ClearDevEnvironment", + "command": "C_Cpp.ClearVSDevEnvironment", "when": "workspacePlatform == windows" }, { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index d00885eb5..f100bbaee 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -37,8 +37,8 @@ "c_cpp.command.RemoveAllCodeAnalysisProblems.title": "Clear All Code Analysis Problems", "c_cpp.command.BuildAndDebugFile.title": "Debug C/C++ File", "c_cpp.command.BuildAndRunFile.title": "Run C/C++ File", - "c_cpp.command.SetDevEnvironment.title": "Set Developer Environment", - "c_cpp.command.ClearDevEnvironment.title": "Clear Developer Environment", + "c_cpp.command.SetVSDevEnvironment.title": "Set Visual Studio Developer Environment", + "c_cpp.command.ClearVSDevEnvironment.title": "Clear Visual Studio Developer Environment", "c_cpp.command.AddDebugConfiguration.title": "Add Debug Configuration", "c_cpp.command.GenerateDoxygenComment.title": "Generate Doxygen Comment", "c_cpp.command.addSshTarget.title": "Add SSH target", @@ -851,7 +851,7 @@ ] }, "c_cpp.configuration.debugShortcut.description": "Show the \"Run and Debug\" play button and \"Add Debug Configuration\" gear in the editor title bar for C++ files.", - "c_cpp.configuration.persistDevEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", + "c_cpp.configuration.persistVSDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", "c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).", "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.", "c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", @@ -1068,9 +1068,9 @@ ] }, "c_cpp.walkthrough.command.prompt.description": { - "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetDevEnvironment?%22walkthrough%22)", + "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVSDevEnvironment?%22walkthrough%22)", "comment": [ - "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetDevEnvironment?%22walkthrough%22)\"}" + "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetVSDevEnvironment?%22walkthrough%22)\"}" ] }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 13d46e7c2..8338f081c 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -586,31 +586,37 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv * @returns `true` if the Developer Environment is not available and an error was shown to the user, `false` if the Developer Environment is available or the user chose to apply it. */ private async showErrorIfClNotAvailable(_configurationLabel: string): Promise { - if (!util.hasMsvcEnvironment()) { - const applyDevEnv = localize("apply.dev.env", "Apply Developer Environment"); - const cancel = localize("cancel", "Cancel"); - const response = await vscode.window.showErrorMessage( - localize({ - key: "cl.exe.not.available", - comment: ["{0} is a command option in a menu."] - }, "{0} requires the Visual Studio Developer Environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), - applyDevEnv, - cancel); - if (response === applyDevEnv) { - try { - await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'buildAndDebug'); - } catch { - // Ignore the error, the user will be prompted to apply the environment manually. - } - } - if (util.hasMsvcEnvironment()) { - return false; + if (util.hasMsvcEnvironment()) { + return false; // No error to show + } + + const applyDevEnv = localize("apply.dev.env", "Apply Developer Environment"); + const cancel = localize("cancel", "Cancel"); + const response = await vscode.window.showErrorMessage( + localize({ + key: "cl.exe.not.available", + comment: ["{0} is a command option in a menu."] + }, "{0} requires the Visual Studio Developer Environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), + applyDevEnv, + cancel); + if (response === applyDevEnv) { + try { + await vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'buildAndDebug'); + } catch (e: any) { + // Ignore the error, the user will be prompted to apply the environment manually. } - void vscode.window.showErrorMessage( - localize('dev.env.not.applied', 'The Visual Studio Developer Environment was not applied. Please try again or run VS Code from the Developer Command Prompt for VS.')); + } + if (response === cancel) { + // A message was already shown, so exit early noting that the environment is not available. We don't need to show another error message. return true; } - return false; + + if (util.hasMsvcEnvironment()) { + return false; + } + void vscode.window.showErrorMessage( + localize('dev.env.not.applied', 'The Visual Studio Developer Environment was not applied. Please try again or run VS Code from the Developer Command Prompt for VS.')); + return true; } private getLLDBFrameworkPath(): string | undefined { diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index 896eae215..e35dd21b2 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -16,9 +16,9 @@ nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFo const localize: nls.LocalizeFunc = nls.loadMessageBundle(); const errorNoContext = localize('no.context.provided', 'No context provided'); -const errorNotWindows = localize('not.windows', 'This command is only available on Windows'); +const errorNotWindows = localize('not.windows', 'The "Set Visual Studio Developer Environment" command is only available on Windows'); const errorNoVSFound = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); -const errorOperationCancelled = localize('operation.cancelled', 'The operation was cancelled'); +export const errorOperationCancelled = localize('operation.cancelled', 'The operation was cancelled'); const errorNoHostsFound = localize('no.hosts', 'No hosts found'); const configuringDevEnv = localize('config.dev.env', 'Configuring Developer Environment...'); const selectVSInstallation = localize('select.vs.install', 'Select a Visual Studio installation'); @@ -74,7 +74,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { for (const key of Object.keys(vars)) { context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); } - context.environmentVariableCollection.description = localize('dev.env.for', '{0} Developer Environment for {1}', arch, vs.displayName); + context.environmentVariableCollection.description = localize('dev.env.for', '{0} Developer Environment for {1}', arch, vsDisplayNameWithSuffix(vs)); context.environmentVariableCollection.persistent = settings.persistDevEnvironment; return true; @@ -94,10 +94,24 @@ async function getVSInstallations() { return installations; } +function vsDisplayNameWithSuffix(installation: vswhere.Installation): string { + const suffix = (() => { + if (installation.channelId.endsWith('.main')) { + return 'main'; + } else if (installation.channelId.endsWith('.IntPreview')) { + return 'Int Preview'; + } else if (installation.channelId.endsWith('.Preview')) { + return 'Preview'; + } + return ''; + })(); + return `${installation.displayName}${suffix ? ` ${suffix}` : ''}`; +} + async function chooseVSInstallation(installations: vswhere.Installation[]): Promise { const items: vscode.QuickPickItem[] = installations.map(installation => { - label: installation.displayName, - description: localize('default.settings', 'Default settings for {0}', installation.displayName) + label: vsDisplayNameWithSuffix(installation), + detail: localize('default.env', 'Default environment for {0}', installation.catalog.productDisplayVersion) }); items.push({ label: advancedOptions, @@ -110,7 +124,7 @@ async function chooseVSInstallation(installations: vswhere.Installation[]): Prom throw new Error(errorOperationCancelled); } - return installations.find(installation => installation.displayName === selection.label); + return installations.find(installation => vsDisplayNameWithSuffix(installation) === selection.label); } interface Compiler { @@ -143,7 +157,7 @@ async function chooseCompiler(vses: vswhere.Installation[]): Promise { label: compiler.version, - description: compiler.vs.displayName + description: vsDisplayNameWithSuffix(compiler.vs) }); const selection = await vscode.window.showQuickPick(items, { placeHolder: selectToolsetVersion @@ -151,7 +165,7 @@ async function chooseCompiler(vses: vswhere.Installation[]): Promise compiler.version === selection.label && compiler.vs.displayName === selection.description); + return compilers.find(compiler => compiler.version === selection.label && vsDisplayNameWithSuffix(compiler.vs) === selection.description); } async function setOptions(compiler: Compiler): Promise { diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 7a3de0082..4b8f9eba8 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -29,7 +29,7 @@ import { CodeActionDiagnosticInfo, CodeAnalysisDiagnosticIdentifiersAndUri, code import { registerRelatedFilesProvider } from './copilotProviders'; import { CppBuildTaskProvider } from './cppBuildTaskProvider'; import { getCustomConfigProviders } from './customProviders'; -import { setEnvironment } from './devcmd'; +import { errorOperationCancelled, setEnvironment } from './devcmd'; import { getLanguageConfig } from './languageConfig'; import { CppConfigurationLanguageModelTool } from './lmTool'; import { getLocaleId } from './localization'; @@ -432,8 +432,8 @@ export async function registerCommands(enabled: boolean): Promise { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? onSetDevEnvironment : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? onClearDevEnvironment : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetVSDevEnvironment', enabled ? onSetVSDevEnvironment : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearVSDevEnvironment', enabled ? onClearVSDevEnvironment : onDisabledCommand)); } function onDisabledCommand() { @@ -1554,23 +1554,27 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho return true; } -async function onSetDevEnvironment(sender?: any): Promise { +async function onSetVSDevEnvironment(sender?: any): Promise { let success: boolean = true; try { await setEnvironment(util.extensionContext); await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); - void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); + if (sender !== 'buildAndDebug') { + void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`); + } } catch (error: any) { success = false; if (!isWindows) { throw error; } - void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`); + if (error.message !== errorOperationCancelled) { + void vscode.window.showErrorMessage(`Failed to apply VS developer environment: ${error.message}`); + } } - telemetry.logLanguageServerEvent("SetDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() }); + telemetry.logLanguageServerEvent("SetVSDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() }); } -async function onClearDevEnvironment(): Promise { +async function onClearVSDevEnvironment(): Promise { util.extensionContext?.environmentVariableCollection.clear(); await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index eb4b8afa9..e88aadae6 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -551,7 +551,7 @@ export class CppSettings extends Settings { && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get sshTargetsView(): string { return this.getAsString("sshTargetsView"); } - public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistDevEnvironment"); } + public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistVSDeveloperEnvironment"); } // Returns the value of a setting as a string with proper type validation and checks for valid enum values while returning an undefined value if necessary. private getAsStringOrUndefined(settingName: string): string | undefined { diff --git a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts index 95e2d0926..8a2e08a5a 100644 --- a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts +++ b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts @@ -7,11 +7,12 @@ import { suite } from 'mocha'; import * as vscode from 'vscode'; import * as util from '../../../../src/common'; import { isWindows } from "../../../../src/constants"; +import { errorOperationCancelled } from '../../../../src/LanguageServer/devcmd'; suite("set developer environment", () => { if (isWindows) { test("set developer environment (Windows)", async () => { - const promise = vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'test'); + const promise = vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'test'); const timer = setInterval(() => { void vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); }, 1000); @@ -22,11 +23,11 @@ suite("set developer environment", () => { } else { test("set developer environment (Linux/macOS)", async () => { try { - await vscode.commands.executeCommand('C_Cpp.SetDevEnvironment', 'test'); + await vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'test'); equal(false, true, "Should not be able to set developer environment on non-Windows platform."); } catch (e) { - equal((e as Error).message, 'This command is only available on Windows', "Should throw error when trying to set developer environment on non-Windows platform."); + equal((e as Error).message, errorOperationCancelled, "Should throw error when trying to set developer environment on non-Windows platform."); } equal(util.hasMsvcEnvironment(), false, "MSVC environment should not be set on non-Windows platforms."); }); From 6f74d9694a92f1a4e5bcccb589133ca4c07d8347 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Mon, 5 May 2025 16:33:51 -0700 Subject: [PATCH 16/30] Address PR feedback --- Extension/src/Debugger/configurationProvider.ts | 15 +++++++++------ .../src/LanguageServer/cppBuildTaskProvider.ts | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 8338f081c..9b880a872 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -87,6 +87,9 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv const defaultConfig: CppDebugConfiguration[] = this.findDefaultConfig(configs); // If there was only one config defined for the default task, choose that config, otherwise ask the user to choose. if (defaultConfig.length === 1) { + if (this.isClConfiguration(defaultConfig[0].name) && await this.showErrorIfClNotAvailable(defaultConfig[0].label)) { + return []; // Cannot continue with build/debug. + } return defaultConfig; } @@ -120,8 +123,8 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return []; // User canceled it. } - if (this.isClConfiguration(selection.label)) { - await this.showErrorIfClNotAvailable(selection.label); + if (this.isClConfiguration(selection.label) && await this.showErrorIfClNotAvailable(selection.label)) { + return []; // Cannot continue with build/debug. } return [selection.configuration]; @@ -578,8 +581,8 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return `${localize("build.and.debug.active.file", 'build and debug active file')}`; } - private isClConfiguration(configurationLabel: string): boolean { - return configurationLabel.startsWith("C/C++: cl.exe"); + private isClConfiguration(configurationLabel?: string): boolean { + return !!configurationLabel?.startsWith("C/C++: cl.exe"); } /** @@ -606,7 +609,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv // Ignore the error, the user will be prompted to apply the environment manually. } } - if (response === cancel) { + if (response === cancel || response === undefined) { // A message was already shown, so exit early noting that the environment is not available. We don't need to show another error message. return true; } @@ -615,7 +618,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return false; } void vscode.window.showErrorMessage( - localize('dev.env.not.applied', 'The Visual Studio Developer Environment was not applied. Please try again or run VS Code from the Developer Command Prompt for VS.')); + localize('dev.env.not.applied', 'The source code could not be built because the Visual Studio Developer Environment was not applied.')); return true; } diff --git a/Extension/src/LanguageServer/cppBuildTaskProvider.ts b/Extension/src/LanguageServer/cppBuildTaskProvider.ts index 3002965dd..085cf988a 100644 --- a/Extension/src/LanguageServer/cppBuildTaskProvider.ts +++ b/Extension/src/LanguageServer/cppBuildTaskProvider.ts @@ -246,7 +246,7 @@ export class CppBuildTaskProvider implements TaskProvider { const cppBuildTask: CppBuildTask = new Task(definition, TaskScope.Workspace, task.label, ext.CppSourceStr); cppBuildTask.detail = task.detail; cppBuildTask.existing = true; - if (!util.isString(task.group) && task.group.isDefault) { + if (util.isObject(task.group) && task.group.isDefault) { cppBuildTask.isDefault = true; } return cppBuildTask; From 4dace48ddb253f1ffb8ac65dbb1f75da9716cd53 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 6 May 2025 09:06:33 -0700 Subject: [PATCH 17/30] rename telemetry property --- Extension/src/LanguageServer/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 4b8f9eba8..bf39a54e5 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1571,7 +1571,7 @@ async function onSetVSDevEnvironment(sender?: any): Promise { void vscode.window.showErrorMessage(`Failed to apply VS developer environment: ${error.message}`); } } - telemetry.logLanguageServerEvent("SetVSDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() }); + telemetry.logLanguageServerEvent("SetVSDevEnvironment", { "sender": util.getSenderType(sender), "resultcode": success.toString() }); } async function onClearVSDevEnvironment(): Promise { From 93ef55653e6c68283975a5e64160f764f6a481cb Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 6 May 2025 16:23:52 -0700 Subject: [PATCH 18/30] PR feedback --- Extension/package.json | 16 ++++++++-------- Extension/package.nls.json | 10 +++++----- Extension/src/Debugger/configurationProvider.ts | 2 +- Extension/src/LanguageServer/extension.ts | 10 +++++----- Extension/src/LanguageServer/settings.ts | 2 +- .../tests/devEnvironment.test.ts | 11 ++++++++--- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 7c9dea79e..c778df584 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3539,10 +3539,10 @@ "markdownDescription": "%c_cpp.configuration.windowsErrorReportingMode.markdownDescription%", "scope": "window" }, - "C_Cpp.persistVSDeveloperEnvironment": { + "C_Cpp.persistVsDeveloperEnvironment": { "type": "boolean", "default": true, - "markdownDescription": "%c_cpp.configuration.persistVSDeveloperEnvironment.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription%", "scope": "window" } } @@ -3710,13 +3710,13 @@ "icon": "$(run)" }, { - "command": "C_Cpp.SetVSDevEnvironment", - "title": "%c_cpp.command.SetVSDevEnvironment.title%", + "command": "C_Cpp.SetVsDeveloperEnvironment", + "title": "%c_cpp.command.SetVsDeveloperEnvironment.title%", "category": "C/C++" }, { - "command": "C_Cpp.ClearVSDevEnvironment", - "title": "%c_cpp.command.ClearVSDevEnvironment.title%", + "command": "C_Cpp.ClearVsDeveloperEnvironment", + "title": "%c_cpp.command.ClearVsDeveloperEnvironment.title%", "category": "C/C++" }, { @@ -6162,11 +6162,11 @@ "when": "editorLangId =~ /^(c|(cuda-)?cpp)$/ && config.C_Cpp.debugShortcut && cpptools.buildAndDebug.isSourceFile" }, { - "command": "C_Cpp.SetVSDevEnvironment", + "command": "C_Cpp.SetVsDeveloperEnvironment", "when": "workspacePlatform == windows" }, { - "command": "C_Cpp.ClearVSDevEnvironment", + "command": "C_Cpp.ClearVsDeveloperEnvironment", "when": "workspacePlatform == windows" }, { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index f100bbaee..13bd7c3be 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -37,8 +37,8 @@ "c_cpp.command.RemoveAllCodeAnalysisProblems.title": "Clear All Code Analysis Problems", "c_cpp.command.BuildAndDebugFile.title": "Debug C/C++ File", "c_cpp.command.BuildAndRunFile.title": "Run C/C++ File", - "c_cpp.command.SetVSDevEnvironment.title": "Set Visual Studio Developer Environment", - "c_cpp.command.ClearVSDevEnvironment.title": "Clear Visual Studio Developer Environment", + "c_cpp.command.SetVsDeveloperEnvironment.title": "Set Visual Studio Developer Environment", + "c_cpp.command.ClearVsDeveloperEnvironment.title": "Clear Visual Studio Developer Environment", "c_cpp.command.AddDebugConfiguration.title": "Add Debug Configuration", "c_cpp.command.GenerateDoxygenComment.title": "Generate Doxygen Comment", "c_cpp.command.addSshTarget.title": "Add SSH target", @@ -851,7 +851,7 @@ ] }, "c_cpp.configuration.debugShortcut.description": "Show the \"Run and Debug\" play button and \"Add Debug Configuration\" gear in the editor title bar for C++ files.", - "c_cpp.configuration.persistVSDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", + "c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", "c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).", "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.", "c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", @@ -1068,9 +1068,9 @@ ] }, "c_cpp.walkthrough.command.prompt.description": { - "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVSDevEnvironment?%22walkthrough%22)", + "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)", "comment": [ - "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetVSDevEnvironment?%22walkthrough%22)\"}" + "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" ] }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 9b880a872..55a61a0d3 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -604,7 +604,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv cancel); if (response === applyDevEnv) { try { - await vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'buildAndDebug'); + await vscode.commands.executeCommand('C_Cpp.SetVsDeveloperEnvironment', 'buildAndDebug'); } catch (e: any) { // Ignore the error, the user will be prompted to apply the environment manually. } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index bf39a54e5..e9b0e28e7 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -432,8 +432,8 @@ export async function registerCommands(enabled: boolean): Promise { commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand)); commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetVSDevEnvironment', enabled ? onSetVSDevEnvironment : onDisabledCommand)); - commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearVSDevEnvironment', enabled ? onClearVSDevEnvironment : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetVsDeveloperEnvironment', enabled ? onSetVsDeveloperEnvironment : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearVsDeveloperEnvironment', enabled ? onClearVsDeveloperEnvironment : onDisabledCommand)); } function onDisabledCommand() { @@ -1554,7 +1554,7 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho return true; } -async function onSetVSDevEnvironment(sender?: any): Promise { +async function onSetVsDeveloperEnvironment(sender?: any): Promise { let success: boolean = true; try { await setEnvironment(util.extensionContext); @@ -1571,10 +1571,10 @@ async function onSetVSDevEnvironment(sender?: any): Promise { void vscode.window.showErrorMessage(`Failed to apply VS developer environment: ${error.message}`); } } - telemetry.logLanguageServerEvent("SetVSDevEnvironment", { "sender": util.getSenderType(sender), "resultcode": success.toString() }); + telemetry.logLanguageServerEvent("SetVsDeveloperEnvironment", { "sender": util.getSenderType(sender), "resultcode": success.toString() }); } -async function onClearVSDevEnvironment(): Promise { +async function onClearVsDeveloperEnvironment(): Promise { util.extensionContext?.environmentVariableCollection.clear(); await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment()); } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index e88aadae6..ca6ff71ae 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -551,7 +551,7 @@ export class CppSettings extends Settings { && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get sshTargetsView(): string { return this.getAsString("sshTargetsView"); } - public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistVSDeveloperEnvironment"); } + public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistVsDeveloperEnvironment"); } // Returns the value of a setting as a string with proper type validation and checks for valid enum values while returning an undefined value if necessary. private getAsStringOrUndefined(settingName: string): string | undefined { diff --git a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts index 8a2e08a5a..349a8803b 100644 --- a/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts +++ b/Extension/test/scenarios/SimpleCppProject/tests/devEnvironment.test.ts @@ -12,7 +12,7 @@ import { errorOperationCancelled } from '../../../../src/LanguageServer/devcmd'; suite("set developer environment", () => { if (isWindows) { test("set developer environment (Windows)", async () => { - const promise = vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'test'); + const promise = vscode.commands.executeCommand('C_Cpp.SetVsDeveloperEnvironment', 'test'); const timer = setInterval(() => { void vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); }, 1000); @@ -20,10 +20,15 @@ suite("set developer environment", () => { clearInterval(timer); equal(util.hasMsvcEnvironment(), true, "MSVC environment not set correctly."); }); + + test("clear developer environment (Windows)", async () => { + await vscode.commands.executeCommand('C_Cpp.ClearVsDeveloperEnvironment'); + equal(util.hasMsvcEnvironment(), false, "MSVC environment not cleared correctly."); + }); } else { - test("set developer environment (Linux/macOS)", async () => { + test("should not be able to set developer environment (Linux/macOS)", async () => { try { - await vscode.commands.executeCommand('C_Cpp.SetVSDevEnvironment', 'test'); + await vscode.commands.executeCommand('C_Cpp.SetVsDeveloperEnvironment', 'test'); equal(false, true, "Should not be able to set developer environment on non-Windows platform."); } catch (e) { From c5ba01c866bf86b5eefdc6ce31cde5a091d7c724 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 6 May 2025 16:29:51 -0700 Subject: [PATCH 19/30] consistency in commands and user-visible text --- Extension/package.nls.json | 2 +- Extension/src/Debugger/configurationProvider.ts | 7 ++++--- Extension/src/LanguageServer/cppBuildTaskProvider.ts | 2 +- .../devcommandprompt/open-developer-command-prompt.md | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 13bd7c3be..611c676dc 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1068,7 +1068,7 @@ ] }, "c_cpp.walkthrough.command.prompt.description": { - "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio Developer Environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)", + "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio developer environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)", "comment": [ "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" ] diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 55a61a0d3..cdb1d795f 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -586,7 +586,8 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv } /** - * @returns `true` if the Developer Environment is not available and an error was shown to the user, `false` if the Developer Environment is available or the user chose to apply it. + * @returns `true` if the VS developer environment is not available and an error was shown to the user, + * `false` if the VS developer environment is available or the user chose to apply it. */ private async showErrorIfClNotAvailable(_configurationLabel: string): Promise { if (util.hasMsvcEnvironment()) { @@ -599,7 +600,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv localize({ key: "cl.exe.not.available", comment: ["{0} is a command option in a menu."] - }, "{0} requires the Visual Studio Developer Environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), + }, "{0} requires the Visual Studio developer environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), applyDevEnv, cancel); if (response === applyDevEnv) { @@ -618,7 +619,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return false; } void vscode.window.showErrorMessage( - localize('dev.env.not.applied', 'The source code could not be built because the Visual Studio Developer Environment was not applied.')); + localize('dev.env.not.applied', 'The source code could not be built because the Visual Studio developer environment was not applied.')); return true; } diff --git a/Extension/src/LanguageServer/cppBuildTaskProvider.ts b/Extension/src/LanguageServer/cppBuildTaskProvider.ts index 085cf988a..c40b43714 100644 --- a/Extension/src/LanguageServer/cppBuildTaskProvider.ts +++ b/Extension/src/LanguageServer/cppBuildTaskProvider.ts @@ -432,7 +432,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal { } if (isEnvironmentOverrideApplied(util.extensionContext)) { - // If the user has applied the Developer Environment to this workspace, it should apply to all newly opened terminals. + // If the user has applied the developer environment to this workspace, it should apply to all newly opened terminals. // However, this does not apply to processes that we spawn ourselves in the Pseudoterminal, so we need to specify the // correct environment in order to emulate the terminal behavior properly. const env = { ...process.env }; diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index ea5187dd0..ca6b53c4c 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -3,7 +3,7 @@
  • Start VS Code from the Developer Command Prompt for VS

  • -
  • Run the C/C++: Set Developer Environment command.

    +
  • Run the C/C++: Set Visual Studio Developer Environment command.

To relaunch VS Code using the Developer Command Prompt for VS

From 5f86ebb3e9886791b7c95d81816710da20bcfb5e Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 7 May 2025 11:26:33 -0700 Subject: [PATCH 20/30] fix environment overriding and some string capitalization --- Extension/package.json | 2 +- Extension/package.nls.json | 6 +++--- Extension/src/LanguageServer/devcmd.ts | 4 ++-- .../devcommandprompt/open-developer-command-prompt.md | 2 +- Extension/yarn.lock | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index c778df584..c2e69b301 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6793,7 +6793,7 @@ "node-fetch": "^2.7.0", "node-loader": "^2.0.0", "node-stream-zip": "^1.15.0", - "node-vcvarsall": "^1.0.1", + "node-vcvarsall": "^1.1.0", "node-vswhere": "^1.0.2", "plist": "^3.1.0", "posix-getopt": "^1.2.1", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 611c676dc..57d0a1a54 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1040,9 +1040,9 @@ "c_cpp.debuggers.logging.category.warning.description": "Logs that highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.", "c_cpp.debuggers.logging.category.error.description": "Logs that highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.", "c_cpp.debuggers.logging.category.none.description": "Not used for writing log messages. Specifies that a logging category should not write any messages.", - "c_cpp.walkthrough.title": "Get Started with C++ Development", + "c_cpp.walkthrough.title": "Get started with C++ development", "c_cpp.walkthrough.description": "Dive into VS Code's rich C++ development experience.", - "c_cpp.walkthrough.set.up.title": "Set up your C++ Environment", + "c_cpp.walkthrough.set.up.title": "Set up your C++ environment", "c_cpp.walkthrough.activating.description": "Activating the C++ extension to determine whether your C++ Environment has been set up.\nActivating Extension...", "c_cpp.walkthrough.no.compilers.windows.description": "We could not find a C++ compiler on your machine, which is required to use the C++ extension. Follow the instructions on the right to install one, then click “Find my new Compiler” below.\n[Find my new Compiler](command:C_Cpp.RescanCompilers?%22walkthrough%22)", "c_cpp.walkthrough.no.compilers.description": { @@ -1062,7 +1062,7 @@ }, "c_cpp.walkthrough.create.cpp.file.altText": "Open a C++ file or a folder with a C++ project.", "c_cpp.walkthrough.command.prompt.title": { - "message": "Apply the Visual Studio Developer Environment", + "message": "Apply the Visual Studio developer environment", "comment": [ "{Locked=\"Visual Studio\"}" ] diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index e35dd21b2..e5fdf4f64 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -20,7 +20,7 @@ const errorNotWindows = localize('not.windows', 'The "Set Visual Studio Develope const errorNoVSFound = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found'); export const errorOperationCancelled = localize('operation.cancelled', 'The operation was cancelled'); const errorNoHostsFound = localize('no.hosts', 'No hosts found'); -const configuringDevEnv = localize('config.dev.env', 'Configuring Developer Environment...'); +const configuringDevEnv = localize('config.dev.env', 'Configuring developer environment...'); const selectVSInstallation = localize('select.vs.install', 'Select a Visual Studio installation'); const advancedOptions = localize('advanced.options', 'Advanced options...'); const advancedOptionsDescription = localize('advanced.options.desc', 'Select a specific host/target architecture, toolset version, etc.'); @@ -74,7 +74,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { for (const key of Object.keys(vars)) { context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); } - context.environmentVariableCollection.description = localize('dev.env.for', '{0} Developer Environment for {1}', arch, vsDisplayNameWithSuffix(vs)); + context.environmentVariableCollection.description = localize('dev.env.for', '{0} developer environment for {1}', arch, vsDisplayNameWithSuffix(vs)); context.environmentVariableCollection.persistent = settings.persistDevEnvironment; return true; diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index ca6b53c4c..8500f1190 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,4 +1,4 @@ -

Apply the Visual Studio Developer Environment

+

Apply the Visual Studio developer environment

The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied. You only need to do one of the following:

  • Start VS Code from the Developer Command Prompt for VS

    diff --git a/Extension/yarn.lock b/Extension/yarn.lock index f355dcf81..5404bed2a 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3559,10 +3559,10 @@ node-stream-zip@^1.15.0: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea" integrity sha1-FYrbiO2ABMbEmjlrUKal3jvKM+o= -node-vcvarsall@^1.0.1: - version "1.0.1" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.0.1.tgz#d7ee885e4ca41f0f0d814e3a277995cc95ff20b0" - integrity sha1-1+6IXkykHw8NgU46J3mVzJX/ILA= +node-vcvarsall@^1.1.0: + version "1.1.0" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.1.0.tgz#4e0b3959f0d5bc6114c8c61e20ac0caab9dcbecf" + integrity sha1-Tgs5WfDVvGEUyMYeIKwMqrncvs8= dependencies: node-vswhere "^1.0.2" tmp "^0.2.1" From fdf63716f18539c0038cc18e652b9e5b4f3ef254 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 7 May 2025 11:30:36 -0700 Subject: [PATCH 21/30] update the settings wrapper --- Extension/src/LanguageServer/devcmd.ts | 2 +- Extension/src/LanguageServer/settings.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index e5fdf4f64..a1b2e7595 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -75,7 +75,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { context.environmentVariableCollection.replace(key, vars[key].replace(`%${key}%`, '${env:' + key + '}')); } context.environmentVariableCollection.description = localize('dev.env.for', '{0} developer environment for {1}', arch, vsDisplayNameWithSuffix(vs)); - context.environmentVariableCollection.persistent = settings.persistDevEnvironment; + context.environmentVariableCollection.persistent = settings.persistVSDeveloperEnvironment; return true; } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index ca6ff71ae..209b347d9 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -551,7 +551,7 @@ export class CppSettings extends Settings { && this.intelliSenseEngine.toLowerCase() === "default" && vscode.workspace.getConfiguration("workbench").get("colorTheme") !== "Default High Contrast"; } public get sshTargetsView(): string { return this.getAsString("sshTargetsView"); } - public get persistDevEnvironment(): boolean { return this.getAsBoolean("persistVsDeveloperEnvironment"); } + public get persistVSDeveloperEnvironment(): boolean { return this.getAsBoolean("persistVsDeveloperEnvironment"); } // Returns the value of a setting as a string with proper type validation and checks for valid enum values while returning an undefined value if necessary. private getAsStringOrUndefined(settingName: string): string | undefined { From 731bd01d1b3d45964300bea11cfda8eb3b5a362c Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 7 May 2025 14:42:12 -0700 Subject: [PATCH 22/30] update locked string --- Extension/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 57d0a1a54..4c752fd36 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1070,7 +1070,7 @@ "c_cpp.walkthrough.command.prompt.description": { "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio developer environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)", "comment": [ - "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" + "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" ] }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", From 4cd1a407b152e9abe28378f9432d3fce0fa13602 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 7 May 2025 15:22:03 -0700 Subject: [PATCH 23/30] PR feedback --- Extension/package.json | 2 +- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/client.ts | 14 ++++++++++---- Extension/src/LanguageServer/devcmd.ts | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index c2e69b301..008b9cc59 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3542,7 +3542,7 @@ "C_Cpp.persistVsDeveloperEnvironment": { "type": "boolean", "default": true, - "markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.description%", "scope": "window" } } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 4c752fd36..efc7146bd 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -851,7 +851,7 @@ ] }, "c_cpp.configuration.debugShortcut.description": "Show the \"Run and Debug\" play button and \"Add Debug Configuration\" gear in the editor title bar for C++ files.", - "c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", + "c_cpp.configuration.persistVsDeveloperEnvironment.description": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.", "c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).", "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.", "c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 246a74c6b..65fc599cc 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1796,10 +1796,10 @@ export class DefaultClient implements Client { if (Object.keys(changedSettings).length > 0) { if (this === defaultClient) { - if (changedSettings.commentContinuationPatterns) { + if (changedSettings.commentContinuationPatterns !== undefined) { updateLanguageConfigurations(); } - if (changedSettings.loggingLevel) { + if (changedSettings.loggingLevel !== undefined) { const oldLoggingLevelLogged: boolean = this.loggingLevel > 1; this.loggingLevel = util.getNumericLoggingLevel(changedSettings.loggingLevel); if (oldLoggingLevelLogged || this.loggingLevel > 1) { @@ -1807,7 +1807,7 @@ export class DefaultClient implements Client { } } const settings: CppSettings = new CppSettings(); - if (changedSettings.enhancedColorization) { + if (changedSettings.enhancedColorization !== undefined) { if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) { this.semanticTokensProvider = new SemanticTokensProvider(); this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend); @@ -1849,12 +1849,18 @@ export class DefaultClient implements Client { void ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, showButtonSender); } } - if (changedSettings.legacyCompilerArgsBehavior) { + if (changedSettings.legacyCompilerArgsBehavior !== undefined) { this.configuration.handleConfigurationChange(); } if (changedSettings["default.compilerPath"] !== undefined || changedSettings["default.compileCommands"] !== undefined || changedSettings["default.configurationProvider"] !== undefined) { void ui.ShowConfigureIntelliSenseButton(false, this).catch(logAndReturn.undefined); } + if (changedSettings.persistVsDeveloperEnvironment !== undefined) { + if (util.extensionContext) { + const settings: CppSettings = new CppSettings(); + util.extensionContext.environmentVariableCollection.persistent = settings.persistVSDeveloperEnvironment; + } + } this.configuration.onDidChangeSettings(); telemetry.logLanguageServerEvent("CppSettingsChange", changedSettings, undefined); } diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index a1b2e7595..bd0bfd88d 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -68,7 +68,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { host: match(host, { 'x86': 'x86', 'x64': 'x64' }) ?? 'x64', target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64' }); - const settings = new CppSettings(vscode.workspace.workspaceFolders?.at(0)?.uri); + const settings = new CppSettings(); context.environmentVariableCollection.clear(); for (const key of Object.keys(vars)) { From f7e6a05405a4905f248a7a92bd26f0fbefb1c655 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Thu, 8 May 2025 11:56:26 -0700 Subject: [PATCH 24/30] handle outdated vs environment --- .../src/Debugger/configurationProvider.ts | 40 +++++++++++++------ .../LanguageServer/cppBuildTaskProvider.ts | 17 ++------ Extension/src/LanguageServer/devcmd.ts | 28 ++++++++++++- Extension/src/common.ts | 4 +- 4 files changed, 60 insertions(+), 29 deletions(-) diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index cdb1d795f..559011251 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -15,6 +15,7 @@ import * as util from '../common'; import { isWindows } from '../constants'; import { expandAllStrings, ExpansionOptions, ExpansionVars } from '../expand'; import { CppBuildTask, CppBuildTaskDefinition, cppBuildTaskProvider } from '../LanguageServer/cppBuildTaskProvider'; +import { canFindCl } from '../LanguageServer/devcmd'; import { configPrefix } from '../LanguageServer/extension'; import { CppSettings, OtherSettings } from '../LanguageServer/settings'; import * as logger from '../logger'; @@ -590,20 +591,34 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv * `false` if the VS developer environment is available or the user chose to apply it. */ private async showErrorIfClNotAvailable(_configurationLabel: string): Promise { - if (util.hasMsvcEnvironment()) { - return false; // No error to show + const hasEnvironment = util.hasMsvcEnvironment(); + if (hasEnvironment) { + if (await canFindCl()) { + return false; // No error to show + } + // The user has an environment but cl.exe cannot be found. Prompt the user to update the environment. } - const applyDevEnv = localize("apply.dev.env", "Apply Developer Environment"); - const cancel = localize("cancel", "Cancel"); - const response = await vscode.window.showErrorMessage( - localize({ + const applyButton = localize("apply.dev.env", "Apply Developer Environment"); + const applyMessage = localize( + { key: "cl.exe.not.available", comment: ["{0} is a command option in a menu."] - }, "{0} requires the Visual Studio developer environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`), - applyDevEnv, + }, + "{0} requires the Visual Studio developer environment.", `cl.exe ${this.buildAndDebugActiveFileStr()}`); + const updateButton = localize("update.dev.env", "Update Developer Environment"); + const updateMessage = localize( + { + key: "update.dev.env", + comment: ["{0} is a command option in a menu."] + }, + "{0} requires the Visual Studio developer environment to be updated.", `cl.exe ${this.buildAndDebugActiveFileStr()}`); + const cancel = localize("cancel", "Cancel"); + const response = await vscode.window.showErrorMessage( + hasEnvironment ? updateMessage : applyMessage, + hasEnvironment ? updateButton : applyButton, cancel); - if (response === applyDevEnv) { + if (response === applyButton || response === updateButton) { try { await vscode.commands.executeCommand('C_Cpp.SetVsDeveloperEnvironment', 'buildAndDebug'); } catch (e: any) { @@ -615,11 +630,12 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv return true; } - if (util.hasMsvcEnvironment()) { + if (util.hasMsvcEnvironment() && await canFindCl()) { return false; } - void vscode.window.showErrorMessage( - localize('dev.env.not.applied', 'The source code could not be built because the Visual Studio developer environment was not applied.')); + const notAppliedMessage = localize("dev.env.not.applied", "The source code could not be built because the Visual Studio developer environment was not applied."); + const notFoundMessage = localize("dev.env.not.found", "The source code could not be built because the Visual C++ compiler could not be found."); + void vscode.window.showErrorMessage(hasEnvironment ? notFoundMessage : notAppliedMessage); return true; } diff --git a/Extension/src/LanguageServer/cppBuildTaskProvider.ts b/Extension/src/LanguageServer/cppBuildTaskProvider.ts index c40b43714..cfe39f982 100644 --- a/Extension/src/LanguageServer/cppBuildTaskProvider.ts +++ b/Extension/src/LanguageServer/cppBuildTaskProvider.ts @@ -6,13 +6,13 @@ import * as cp from "child_process"; import * as os from 'os'; import * as path from 'path'; -import { CustomExecution, Disposable, EnvironmentVariableMutator, Event, EventEmitter, ProcessExecution, Pseudoterminal, ShellExecution, Task, TaskDefinition, TaskEndEvent, TaskExecution, TaskGroup, TaskProvider, tasks, TaskScope, TerminalDimensions, TextEditor, window, workspace, WorkspaceFolder } from 'vscode'; +import { CustomExecution, Disposable, Event, EventEmitter, ProcessExecution, Pseudoterminal, ShellExecution, Task, TaskDefinition, TaskEndEvent, TaskExecution, TaskGroup, TaskProvider, tasks, TaskScope, TerminalDimensions, TextEditor, window, workspace, WorkspaceFolder } from 'vscode'; import * as nls from 'vscode-nls'; import * as util from '../common'; import * as telemetry from '../telemetry'; import { Client } from './client'; import * as configs from './configurations'; -import { isEnvironmentOverrideApplied } from "./devcmd"; +import { getEffectiveEnvironment, isEnvironmentOverrideApplied } from "./devcmd"; import * as ext from './extension'; import { OtherSettings } from './settings'; @@ -431,20 +431,11 @@ class CustomBuildTaskTerminal implements Pseudoterminal { } } - if (isEnvironmentOverrideApplied(util.extensionContext)) { + if (isEnvironmentOverrideApplied()) { // If the user has applied the developer environment to this workspace, it should apply to all newly opened terminals. // However, this does not apply to processes that we spawn ourselves in the Pseudoterminal, so we need to specify the // correct environment in order to emulate the terminal behavior properly. - const env = { ...process.env }; - util.extensionContext?.environmentVariableCollection.forEach((variable: string, mutator: EnvironmentVariableMutator) => { - if (variable.toLowerCase() === "path") { - // Path is special because it has a placeholder to insert the current Path into. - env[variable] = util.resolveVariables(mutator.value); - } else { - env[variable] = mutator.value; - } - }); - this.options.env = env; + this.options.env = getEffectiveEnvironment(); } const splitWriteEmitter = (lines: string | Buffer) => { diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index bd0bfd88d..823217f90 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -9,6 +9,7 @@ import { vswhere } from 'node-vswhere'; import * as path from 'path'; import * as vscode from 'vscode'; import * as nls from 'vscode-nls'; +import { extensionContext, isString, resolveVariables, whichAsync } from '../common'; import { isWindows } from '../constants'; import { CppSettings } from './settings'; @@ -27,8 +28,31 @@ const advancedOptionsDescription = localize('advanced.options.desc', 'Select a s const selectToolsetVersion = localize('select.toolset', 'Select a toolset version'); const selectHostTargetArch = localize('select.host.target', 'Select a host and target architecture'); -export function isEnvironmentOverrideApplied(context?: vscode.ExtensionContext) { - return context?.environmentVariableCollection.get('VCToolsInstallDir') !== undefined; +export function isEnvironmentOverrideApplied(): boolean { + return extensionContext?.environmentVariableCollection.get('VCToolsInstallDir') !== undefined; +} + +export function getEffectiveEnvironment(): { [key: string]: string | undefined } { + const env = { ...process.env }; + extensionContext?.environmentVariableCollection.forEach((variable: string, mutator: vscode.EnvironmentVariableMutator) => { + if (variable.toLowerCase() === "path") { + // Path is special because it has a placeholder to insert the current Path into. + env[variable] = resolveVariables(mutator.value); + } else { + env[variable] = mutator.value; + } + }); + return env; +} + +export async function canFindCl(): Promise { + if (!isWindows) { + return false; + } + const pathOverride = resolveVariables(extensionContext?.environmentVariableCollection.get('Path')?.value); + const path = pathOverride ?? process.env['Path']; + const found = await whichAsync('cl.exe', path); + return isString(found); } export async function setEnvironment(context?: vscode.ExtensionContext) { diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 4123de009..e6a5b0c96 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -1524,9 +1524,9 @@ export interface ISshLocalForwardInfo { remoteSocket?: string; } -export function whichAsync(name: string): Promise { +export function whichAsync(name: string, path?: string): Promise { return new Promise(resolve => { - which(name, (err, resolved) => { + which(name, path ? { path } : {}, (err, resolved) => { if (err) { resolve(undefined); } else { From 27f68c6c1ad93d92e77cff5dde172e7355cff63f Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Mon, 12 May 2025 14:13:33 -0700 Subject: [PATCH 25/30] PR feedback --- Extension/src/LanguageServer/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index e9b0e28e7..89ede26ed 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1568,7 +1568,7 @@ async function onSetVsDeveloperEnvironment(sender?: any): Promise { throw error; } if (error.message !== errorOperationCancelled) { - void vscode.window.showErrorMessage(`Failed to apply VS developer environment: ${error.message}`); + void vscode.window.showErrorMessage(`Failed to apply the VS developer environment: ${error.message}`); } } telemetry.logLanguageServerEvent("SetVsDeveloperEnvironment", { "sender": util.getSenderType(sender), "resultcode": success.toString() }); From 88938242f535131b313705175fb33a279dd031a0 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 21 Oct 2025 11:27:25 -0700 Subject: [PATCH 26/30] Address PR feedback --- Extension/package.json | 2 +- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/devcmd.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 008b9cc59..34095e135 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3542,7 +3542,7 @@ "C_Cpp.persistVsDeveloperEnvironment": { "type": "boolean", "default": true, - "markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.description%", + "description": "%c_cpp.configuration.persistVsDeveloperEnvironment.description%", "scope": "window" } } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index efc7146bd..ab888087b 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1070,7 +1070,7 @@ "c_cpp.walkthrough.command.prompt.description": { "message": "When using the Microsoft Visual Studio C++ compiler, the Visual Studio developer environment must be present.\n\nFollow the instructions on the right to relaunch or click the button below.\n[Set Developer Environment](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)", "comment": [ - "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\\\n[\"} {Locked=\"](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" + "{Locked=\"Visual Studio\"} {Locked=\"C++\"} {Locked=\"\n\n\"} {Locked=\"\n[\"} {Locked=\"](command:C_Cpp.SetVsDeveloperEnvironment?%22walkthrough%22)\"}" ] }, "c_cpp.walkthrough.run.debug.title": "Run and debug your C++ file", diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index 823217f90..e282a1016 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -24,7 +24,7 @@ const errorNoHostsFound = localize('no.hosts', 'No hosts found'); const configuringDevEnv = localize('config.dev.env', 'Configuring developer environment...'); const selectVSInstallation = localize('select.vs.install', 'Select a Visual Studio installation'); const advancedOptions = localize('advanced.options', 'Advanced options...'); -const advancedOptionsDescription = localize('advanced.options.desc', 'Select a specific host/target architecture, toolset version, etc.'); +const advancedOptionsDescription = localize('advanced.options.desc', 'Select a specific host and target architecture, toolset version, etc.'); const selectToolsetVersion = localize('select.toolset', 'Select a toolset version'); const selectHostTargetArch = localize('select.host.target', 'Select a host and target architecture'); From ef9afbc28a713a580273ab0c835d3ecbf43b5efa Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 21 Oct 2025 14:39:28 -0700 Subject: [PATCH 27/30] update vcvarsall and tmp --- Extension/package.json | 5 ++--- Extension/yarn.lock | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 34095e135..b6ff7f6de 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6745,7 +6745,6 @@ "@types/semver": "^7.5.8", "@types/shell-quote": "^1.7.5", "@types/sinon": "^17.0.3", - "@types/tmp": "^0.2.6", "@types/which": "^2.0.2", "@types/yauzl": "^2.10.3", "@typescript-eslint/eslint-plugin": "^6.1.0", @@ -6793,13 +6792,13 @@ "node-fetch": "^2.7.0", "node-loader": "^2.0.0", "node-stream-zip": "^1.15.0", - "node-vcvarsall": "^1.1.0", + "node-vcvarsall": "^1.1.1", "node-vswhere": "^1.0.2", "plist": "^3.1.0", "posix-getopt": "^1.2.1", "shell-quote": "^1.8.1", "ssh-config": "^4.4.4", - "tmp": "^0.2.4", + "tmp": "^0.2.5", "vscode-cpptools": "^7.1.1", "vscode-languageclient": "^8.1.0", "vscode-nls": "^5.2.0", diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 5404bed2a..3714420a5 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -537,11 +537,6 @@ resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz#5fd3592ff10c1e9695d377020c033116cc2889f2" integrity sha1-X9NZL/EMHpaV03cCDAMxFswoifI= -"@types/tmp@^0.2.6": - version "0.2.6" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/tmp/-/tmp-0.2.6.tgz#d785ee90c52d7cc020e249c948c36f7b32d1e217" - integrity sha1-14XukMUtfMAg4knJSMNvezLR4hc= - "@types/which@^2.0.2": version "2.0.2" resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/which/-/which-2.0.2.tgz#54541d02d6b1daee5ec01ac0d1b37cecf37db1ae" @@ -3559,13 +3554,13 @@ node-stream-zip@^1.15.0: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea" integrity sha1-FYrbiO2ABMbEmjlrUKal3jvKM+o= -node-vcvarsall@^1.1.0: - version "1.1.0" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.1.0.tgz#4e0b3959f0d5bc6114c8c61e20ac0caab9dcbecf" - integrity sha1-Tgs5WfDVvGEUyMYeIKwMqrncvs8= +node-vcvarsall@^1.1.1: + version "1.1.1" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.1.1.tgz#ec10a9fafcc7fd4033f716f82a04a2a5a13e1a62" + integrity sha1-7BCp+vzH/UAz9xb4KgSipaE+GmI= dependencies: node-vswhere "^1.0.2" - tmp "^0.2.1" + tmp "^0.2.5" node-vswhere@^1.0.2: version "1.0.2" @@ -4725,10 +4720,10 @@ timers-ext@^0.1.7: es5-ext "^0.10.64" next-tick "^1.1.0" -tmp@^0.2.4: - version "0.2.4" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/tmp/-/tmp-0.2.4.tgz#c6db987a2ccc97f812f17137b36af2b6521b0d13" - integrity sha1-xtuYeizMl/gS8XE3s2rytlIbDRM= +tmp@^0.2.5: + version "0.2.5" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8" + integrity sha1-sGvNI/DzyDV7QmiRcm0WAVq/2Pg= to-absolute-glob@^2.0.0, to-absolute-glob@^2.0.2: version "2.0.2" From 925e7816b4bee6a72b04d829c51dbe527827357c Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 21 Oct 2025 15:04:31 -0700 Subject: [PATCH 28/30] Minor fixes --- Extension/package.json | 1 + .../devcommandprompt/open-developer-command-prompt.md | 9 +++++---- Extension/yarn.lock | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index b6ff7f6de..565bd1c0d 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6745,6 +6745,7 @@ "@types/semver": "^7.5.8", "@types/shell-quote": "^1.7.5", "@types/sinon": "^17.0.3", + "@types/tmp": "^0.2.6", "@types/which": "^2.0.2", "@types/yauzl": "^2.10.3", "@typescript-eslint/eslint-plugin": "^6.1.0", diff --git a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md index 8500f1190..73ca7953e 100644 --- a/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md +++ b/Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md @@ -1,14 +1,15 @@

    Apply the Visual Studio developer environment

    -

    The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied. You only need to do one of the following:

    +

    The Visual Studio C++ compiler requires several environment variables to be set in order to successfully compile your code. If you are using a Windows machine with the Visual Studio C++ compiler, there are two ways you can ensure the environment is applied.

    +

    You only need to do one of the following:

      -
    • Start VS Code from the Developer Command Prompt for VS

      +
    • Run the C/C++: Set Visual Studio Developer Environment command

    • -
    • Run the C/C++: Set Visual Studio Developer Environment command.

      +
    • Start VS Code from the Developer Command Prompt for VS

    To relaunch VS Code using the Developer Command Prompt for VS

      -
    1. Close the current instance of VS Code

      +
    2. Close the current instance of VS Code.

    3. Open the Developer Command Prompt for VS by typing developer in the Windows Start menu then select the Developer Command Prompt for VS.

    4. diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 3714420a5..0c1e524a3 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -537,6 +537,11 @@ resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz#5fd3592ff10c1e9695d377020c033116cc2889f2" integrity sha1-X9NZL/EMHpaV03cCDAMxFswoifI= +"@types/tmp@^0.2.6": + version "0.2.6" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/tmp/-/tmp-0.2.6.tgz#d785ee90c52d7cc020e249c948c36f7b32d1e217" + integrity sha1-14XukMUtfMAg4knJSMNvezLR4hc= + "@types/which@^2.0.2": version "2.0.2" resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/which/-/which-2.0.2.tgz#54541d02d6b1daee5ec01ac0d1b37cecf37db1ae" From c754776ce2cc1a9bc1bcfb297a1e8afed65d9898 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 21 Oct 2025 15:14:54 -0700 Subject: [PATCH 29/30] Remove dead strings --- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows.md.i18n.json | 4 +--- .../installcompiler/install-compiler-windows10.md.i18n.json | 2 -- .../installcompiler/install-compiler-windows11.md.i18n.json | 2 -- 39 files changed, 13 insertions(+), 91 deletions(-) diff --git a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 55cf76156..665da1465 100644 --- a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "注意", "walkthrough.windows.note1.text": "可以使用 Visual Studio 生成工具中的 C++ 工具集以及 Visual Studio Code 以编译、生成并验证任何 C++ 代码库,前提是同时具有有效的 Visual Studio 许可证(社区版、专业版或企业版),且正积极将其用于开发该 C++ 代码库。", "walkthrough.windows.open.command.prompt": "通过在 Windows “开始”菜单中键入“{1}”打开 {0}。", - "walkthrough.windows.check.install": "通过在 {1} 中键入 {0} 来检查 MSVC 安装。你应该会看到包含版本和基本使用说明的版权消息。", - "walkthrough.windows.note2": "注意", - "walkthrough.windows.note2.text": "要从命令行或 VS Code 使用 MSVC,必须从 {0} 运行。普通 shell (例如 {1}、{2} 或 Windows 命令提示符)未设置必要的路径环境变量。" + "walkthrough.windows.check.install": "通过在 {1} 中键入 {0} 来检查 MSVC 安装。你应该会看到包含版本和基本使用说明的版权消息。" } \ No newline at end of file diff --git a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index b60a412a5..cfcdfd945 100644 --- a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "验证编译器安装", "walkthrough.windows.open.command.prompt": "通过在 Windows “开始”菜单中键入“{1}”打开 {0}。", "walkthrough.windows.check.install": "通过在 {1} 中键入 {0} 来检查 MSVC 安装。你应该会看到包含版本和基本使用说明的版权消息。", - "walkthrough.windows.note2": "注意", - "walkthrough.windows.note2.text": "要从命令行或 VS Code 使用 MSVC,必须从 {0} 运行。普通 shell (例如 {1}、{2} 或 Windows 命令提示符)未设置必要的路径环境变量。", "walkthrough.windows.other.compilers": "其他编译器选项", "walkthrough.windows.text3": "如果面向的是 Windows 中的 Linux,请查看 {0}。或者,可 {1}。", "walkthrough.windows.link.title1": "在 VS Code 中使用 C++ 和 适用于 Linux 的 Windows 子系统(WSL)", diff --git a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index b60a412a5..cfcdfd945 100644 --- a/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/chs/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "验证编译器安装", "walkthrough.windows.open.command.prompt": "通过在 Windows “开始”菜单中键入“{1}”打开 {0}。", "walkthrough.windows.check.install": "通过在 {1} 中键入 {0} 来检查 MSVC 安装。你应该会看到包含版本和基本使用说明的版权消息。", - "walkthrough.windows.note2": "注意", - "walkthrough.windows.note2.text": "要从命令行或 VS Code 使用 MSVC,必须从 {0} 运行。普通 shell (例如 {1}、{2} 或 Windows 命令提示符)未设置必要的路径环境变量。", "walkthrough.windows.other.compilers": "其他编译器选项", "walkthrough.windows.text3": "如果面向的是 Windows 中的 Linux,请查看 {0}。或者,可 {1}。", "walkthrough.windows.link.title1": "在 VS Code 中使用 C++ 和 适用于 Linux 的 Windows 子系统(WSL)", diff --git a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 3efa1f5d5..c45c6dd44 100644 --- a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "備註", "walkthrough.windows.note1.text": "您可以使用 Visual Studio Build Tools 中的 C++ 工具組以及 Visual Studio Code 來編譯、組建及驗證任何 C++ 程式碼基底,只要您也擁有有效的 Visual Studio 授權 (社群版、專業版或企業版),且您正積極開發該 C++ 程式碼基底。", "walkthrough.windows.open.command.prompt": "在 Windows [開始] 功能表中輸入 '{1}',以開啟 {0}。", - "walkthrough.windows.check.install": "將 {0} 輸入 {1},以檢查您的 Microsoft Visual C++ 安裝。畫面會顯示版本的著作權訊息以及基本的使用說明。", - "walkthrough.windows.note2": "備註", - "walkthrough.windows.note2.text": "若要從命令列或 VS Code 使用 MSVC,您必須從 {0} 執行。一般殼層,例如 {1}、{2} 或 Windows 命令提示字元,沒有設定必要的路徑環境變數集。" + "walkthrough.windows.check.install": "將 {0} 輸入 {1},以檢查您的 Microsoft Visual C++ 安裝。畫面會顯示版本的著作權訊息以及基本的使用說明。" } \ No newline at end of file diff --git a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 6465ba0ee..6bfedfef0 100644 --- a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "驗證編譯器安裝", "walkthrough.windows.open.command.prompt": "在 Windows [開始] 功能表中輸入 '{1}',以開啟 {0}。", "walkthrough.windows.check.install": "將 {0} 輸入 {1},以檢查您的 Microsoft Visual C++ 安裝。畫面會顯示版本的著作權訊息以及基本的使用說明。", - "walkthrough.windows.note2": "備註", - "walkthrough.windows.note2.text": "若要從命令列或 VS Code 使用 MSVC,您必須從 {0} 執行。一般殼層,例如 {1}、{2} 或 Windows 命令提示字元,沒有設定必要的路徑環境變數集。", "walkthrough.windows.other.compilers": "其他編譯器選項", "walkthrough.windows.text3": "如果您是以 Windows 的 Linux 為目標,請查看 {0}。或者,您也可以 {1}。", "walkthrough.windows.link.title1": "在 VS Code 中使用 C++ 與 Windows 子系統 Linux 版 (WSL) ", diff --git a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 6465ba0ee..6bfedfef0 100644 --- a/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/cht/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "驗證編譯器安裝", "walkthrough.windows.open.command.prompt": "在 Windows [開始] 功能表中輸入 '{1}',以開啟 {0}。", "walkthrough.windows.check.install": "將 {0} 輸入 {1},以檢查您的 Microsoft Visual C++ 安裝。畫面會顯示版本的著作權訊息以及基本的使用說明。", - "walkthrough.windows.note2": "備註", - "walkthrough.windows.note2.text": "若要從命令列或 VS Code 使用 MSVC,您必須從 {0} 執行。一般殼層,例如 {1}、{2} 或 Windows 命令提示字元,沒有設定必要的路徑環境變數集。", "walkthrough.windows.other.compilers": "其他編譯器選項", "walkthrough.windows.text3": "如果您是以 Windows 的 Linux 為目標,請查看 {0}。或者,您也可以 {1}。", "walkthrough.windows.link.title1": "在 VS Code 中使用 C++ 與 Windows 子系統 Linux 版 (WSL) ", diff --git a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 82d9b7027..c68d82bb5 100644 --- a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Poznámka", "walkthrough.windows.note1.text": "Můžete použít sadu nástrojů C++ z Visual Studio Build Tools spolu s Visual Studio Code ke kompilaci, sestavení a ověření jakékoli kódové báze C++, pokud máte také platnou licenci Visual Studio (buď Community, Pro nebo Enterprise), kterou aktivně používáte k vývoji kódové báze C++.", "walkthrough.windows.open.command.prompt": "Otevřete ho {0} zadáním '{1}' v nabídce Start ve Windows.", - "walkthrough.windows.check.install": "Zkontrolujte instalaci MSVC zadáním {0} do nástroje {1}. Měla by se zobrazit zpráva o autorských právech v popisu verze a základního použití.", - "walkthrough.windows.note2": "Poznámka", - "walkthrough.windows.note2.text": "Pokud chcete použít MSVC z příkazového řádku nebo VS Code, musíte spouštět z {0}. Běžné prostředí, jako je {1}, {2} nebo příkazový řádek Windows, nemá nastavenou nezbytnou proměnnou prostředí cesty." + "walkthrough.windows.check.install": "Zkontrolujte instalaci MSVC zadáním {0} do nástroje {1}. Měla by se zobrazit zpráva o autorských právech v popisu verze a základního použití." } \ No newline at end of file diff --git a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 203ed5223..fff689460 100644 --- a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Ověřování instalace kompilátoru", "walkthrough.windows.open.command.prompt": "Otevřete ho {0} zadáním '{1}' v nabídce Start ve Windows.", "walkthrough.windows.check.install": "Zkontrolujte instalaci MSVC zadáním {0} do nástroje {1}. Měla by se zobrazit zpráva o autorských právech v popisu verze a základního použití.", - "walkthrough.windows.note2": "Poznámka", - "walkthrough.windows.note2.text": "Pokud chcete použít MSVC z příkazového řádku nebo VS Code, musíte spouštět z {0}. Běžné prostředí, jako je {1}, {2} nebo příkazový řádek Windows, nemá nastavenou nezbytnou proměnnou prostředí cesty.", "walkthrough.windows.other.compilers": "Další možnosti kompilátoru", "walkthrough.windows.text3": "Pokud cílíte na Linux z Windows, podívejte se na {0}. Nebo můžete {1}.", "walkthrough.windows.link.title1": "Použití C++ a subsystému Windows pro Linux (WSL) ve VS Code", diff --git a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 203ed5223..fff689460 100644 --- a/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/csy/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Ověřování instalace kompilátoru", "walkthrough.windows.open.command.prompt": "Otevřete ho {0} zadáním '{1}' v nabídce Start ve Windows.", "walkthrough.windows.check.install": "Zkontrolujte instalaci MSVC zadáním {0} do nástroje {1}. Měla by se zobrazit zpráva o autorských právech v popisu verze a základního použití.", - "walkthrough.windows.note2": "Poznámka", - "walkthrough.windows.note2.text": "Pokud chcete použít MSVC z příkazového řádku nebo VS Code, musíte spouštět z {0}. Běžné prostředí, jako je {1}, {2} nebo příkazový řádek Windows, nemá nastavenou nezbytnou proměnnou prostředí cesty.", "walkthrough.windows.other.compilers": "Další možnosti kompilátoru", "walkthrough.windows.text3": "Pokud cílíte na Linux z Windows, podívejte se na {0}. Nebo můžete {1}.", "walkthrough.windows.link.title1": "Použití C++ a subsystému Windows pro Linux (WSL) ve VS Code", diff --git a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 64054f741..2572842f9 100644 --- a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Hinweis", "walkthrough.windows.note1.text": "Sie können das C++-Toolset aus Visual Studio Build Tools zusammen mit Visual Studio Code zum Kompilieren, Erstellen und Überprüfen von C++-Codebasis verwenden, sofern Sie auch über eine gültige Visual Studio-Lizenz (Community, Pro oder Enterprise) verfügen, die Sie aktiv zum Entwickeln dieser C++-Codebasis verwenden.", "walkthrough.windows.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben.", - "walkthrough.windows.check.install": "Überprüfen Sie Ihre MSVC-Installation, indem Sie {0} in {1} eingeben. Es sollten ein Copyrighthinweis mit der Version und der grundlegenden Nutzungsbeschreibung angezeigt werden.", - "walkthrough.windows.note2": "Hinweis", - "walkthrough.windows.note2.text": "Um MSVC mithilfe der Befehlszeile oder mit VS Code zu verwenden, müssen Sie von einem {0} aus ausführen. Für eine normale Shell wie {1}, {2} oder die Windows-Eingabeaufforderung sind die erforderlichen PATH-Umgebungsvariablen nicht festgelegt." + "walkthrough.windows.check.install": "Überprüfen Sie Ihre MSVC-Installation, indem Sie {0} in {1} eingeben. Es sollten ein Copyrighthinweis mit der Version und der grundlegenden Nutzungsbeschreibung angezeigt werden." } \ No newline at end of file diff --git a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 664c7f9a3..4adc886c9 100644 --- a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Überprüfen der Compilerinstallation", "walkthrough.windows.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben.", "walkthrough.windows.check.install": "Überprüfen Sie Ihre MSVC-Installation, indem Sie {0} in {1} eingeben. Es sollten ein Copyrighthinweis mit der Version und der grundlegenden Nutzungsbeschreibung angezeigt werden.", - "walkthrough.windows.note2": "Hinweis", - "walkthrough.windows.note2.text": "Um MSVC mithilfe der Befehlszeile oder mit VS Code zu verwenden, müssen Sie von einem {0} aus ausführen. Für eine normale Shell wie {1}, {2} oder die Windows-Eingabeaufforderung sind die erforderlichen PATH-Umgebungsvariablen nicht festgelegt.", "walkthrough.windows.other.compilers": "Andere Compileroptionen", "walkthrough.windows.text3": "Wenn Sie Linux aus Windows verwenden, lesen Sie {0}. Oder Sie können {1}.", "walkthrough.windows.link.title1": "Verwenden von C++ und Windows-Subsystem für Linux (WSL) in VS Code", diff --git a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 664c7f9a3..4adc886c9 100644 --- a/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/deu/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Überprüfen der Compilerinstallation", "walkthrough.windows.open.command.prompt": "Öffnen Sie die {0}, indem Sie im Windows-Startmenü „{1}“ eingeben.", "walkthrough.windows.check.install": "Überprüfen Sie Ihre MSVC-Installation, indem Sie {0} in {1} eingeben. Es sollten ein Copyrighthinweis mit der Version und der grundlegenden Nutzungsbeschreibung angezeigt werden.", - "walkthrough.windows.note2": "Hinweis", - "walkthrough.windows.note2.text": "Um MSVC mithilfe der Befehlszeile oder mit VS Code zu verwenden, müssen Sie von einem {0} aus ausführen. Für eine normale Shell wie {1}, {2} oder die Windows-Eingabeaufforderung sind die erforderlichen PATH-Umgebungsvariablen nicht festgelegt.", "walkthrough.windows.other.compilers": "Andere Compileroptionen", "walkthrough.windows.text3": "Wenn Sie Linux aus Windows verwenden, lesen Sie {0}. Oder Sie können {1}.", "walkthrough.windows.link.title1": "Verwenden von C++ und Windows-Subsystem für Linux (WSL) in VS Code", diff --git a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 03d8a4619..87bf05f5f 100644 --- a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Nota", "walkthrough.windows.note1.text": "Puede usar el conjunto de herramientas de C++ de Visual Studio Build Tools junto con Visual Studio Code para compilar y comprobar cualquier código base de C++, siempre que también tenga una licencia de Visual Studio válida (Community, Pro o Enterprise) que esté usando de manera activa para desarrollar ese código base de C++.", "walkthrough.windows.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows.", - "walkthrough.windows.check.install": "Compruebe la instalación de MSVC escribiendo {0} en {1}. Debería ver un mensaje de copyright con la versión y la descripción de uso básica.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Para usar MSVC desde la línea de comandos o VS Code, debe ejecutar desde un {0}. Un shell normal como {1}, {2}, o el símbolo del sistema de Windows no tiene establecidas las variables de entorno de ruta de acceso necesarias." + "walkthrough.windows.check.install": "Compruebe la instalación de MSVC escribiendo {0} en {1}. Debería ver un mensaje de copyright con la versión y la descripción de uso básica." } \ No newline at end of file diff --git a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 959cf54ec..3a4c35079 100644 --- a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Comprobación de la instalación del compilador", "walkthrough.windows.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows.", "walkthrough.windows.check.install": "Compruebe la instalación de MSVC escribiendo {0} en {1}. Debería ver un mensaje de copyright con la versión y la descripción de uso básica.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Para usar MSVC desde la línea de comandos o VS Code, debe ejecutar desde un {0}. Un shell normal como {1}, {2}, o el símbolo del sistema de Windows no tiene establecidas las variables de entorno de ruta de acceso necesarias.", "walkthrough.windows.other.compilers": "Otras opciones del compilador", "walkthrough.windows.text3": "Si su objetivo es Linux desde Windows, consulte {0}. O bien, consulte {1}.", "walkthrough.windows.link.title1": "Uso de C++ y Subsistema de Windows para Linux (WSL) en VS Code", diff --git a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 959cf54ec..3a4c35079 100644 --- a/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/esn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Comprobación de la instalación del compilador", "walkthrough.windows.open.command.prompt": "Abra {0} escribiendo '{1}' en el menú Inicio de Windows.", "walkthrough.windows.check.install": "Compruebe la instalación de MSVC escribiendo {0} en {1}. Debería ver un mensaje de copyright con la versión y la descripción de uso básica.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Para usar MSVC desde la línea de comandos o VS Code, debe ejecutar desde un {0}. Un shell normal como {1}, {2}, o el símbolo del sistema de Windows no tiene establecidas las variables de entorno de ruta de acceso necesarias.", "walkthrough.windows.other.compilers": "Otras opciones del compilador", "walkthrough.windows.text3": "Si su objetivo es Linux desde Windows, consulte {0}. O bien, consulte {1}.", "walkthrough.windows.link.title1": "Uso de C++ y Subsistema de Windows para Linux (WSL) en VS Code", diff --git a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index ce51fb14c..3733f2a57 100644 --- a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Remarque", "walkthrough.windows.note1.text": "Vous pouvez utiliser l’ensemble d’outils C++ à partir de Visual Studio Build Tools avec Visual Studio Code pour compiler, générer et vérifier n’importe quelle base de code C++, tant que vous disposez également d’une licence Visual Studio valide (Community, Pro ou Enterprise) que vous utilisez activement pour développer cette base de code C++.", "walkthrough.windows.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows.", - "walkthrough.windows.check.install": "Vérifiez votre installation MSVC en tapant {0} dans le {1}. Vous devez voir un message de Copyright avec la version et la description de l’utilisation de base.", - "walkthrough.windows.note2": "Remarque", - "walkthrough.windows.note2.text": "Pour utiliser MSVC à partir de la ligne de commande ou VS Code, vous devez exécuter à partir d’un {0}. Un interpréteur de commandes ordinaire, tel que {1}, {2} ou l’invite de commandes Windows, n’a pas les variables d’environnement de chemin d’accès nécessaires définies." + "walkthrough.windows.check.install": "Vérifiez votre installation MSVC en tapant {0} dans le {1}. Vous devez voir un message de Copyright avec la version et la description de l’utilisation de base." } \ No newline at end of file diff --git a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 2a025d213..67d6e1d0c 100644 --- a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Vérification de l’installation du compilateur", "walkthrough.windows.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows.", "walkthrough.windows.check.install": "Vérifiez votre installation MSVC en tapant {0} dans le {1}. Vous devez voir un message de Copyright avec la version et la description de l’utilisation de base.", - "walkthrough.windows.note2": "Remarque", - "walkthrough.windows.note2.text": "Pour utiliser MSVC à partir de la ligne de commande ou VS Code, vous devez exécuter à partir d’un {0}. Un interpréteur de commandes ordinaire, tel que {1}, {2} ou l’invite de commandes Windows, n’a pas les variables d’environnement de chemin d’accès nécessaires définies.", "walkthrough.windows.other.compilers": "Autres options du compilateur", "walkthrough.windows.text3": "Si vous ciblez Linux à partir de Windows, consultez {0}. Vous pouvez également {1}.", "walkthrough.windows.link.title1": "Utilisation de C++ et du Sous-système Windows pour Linux (WSL) dans VS Code", diff --git a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 2a025d213..67d6e1d0c 100644 --- a/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/fra/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Vérification de l’installation du compilateur", "walkthrough.windows.open.command.prompt": "Ouvrez le {0} en tapant « {1} » dans le menu Démarrer de Windows.", "walkthrough.windows.check.install": "Vérifiez votre installation MSVC en tapant {0} dans le {1}. Vous devez voir un message de Copyright avec la version et la description de l’utilisation de base.", - "walkthrough.windows.note2": "Remarque", - "walkthrough.windows.note2.text": "Pour utiliser MSVC à partir de la ligne de commande ou VS Code, vous devez exécuter à partir d’un {0}. Un interpréteur de commandes ordinaire, tel que {1}, {2} ou l’invite de commandes Windows, n’a pas les variables d’environnement de chemin d’accès nécessaires définies.", "walkthrough.windows.other.compilers": "Autres options du compilateur", "walkthrough.windows.text3": "Si vous ciblez Linux à partir de Windows, consultez {0}. Vous pouvez également {1}.", "walkthrough.windows.link.title1": "Utilisation de C++ et du Sous-système Windows pour Linux (WSL) dans VS Code", diff --git a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index ef5241252..04053f9ef 100644 --- a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Nota", "walkthrough.windows.note1.text": "È possibile usare il set di strumenti C++ di Visual Studio Build Tools insieme a Visual Studio Code per compilare, creare e verificare qualsiasi codebase C++, purché sia disponibile una licenza di Visual Studio valida (Community, Pro o Enterprise) usata attivamente per sviluppare la codebase C++.", "walkthrough.windows.open.command.prompt": "Aprire {0} digitando '{1}' nel menu Start di Windows.", - "walkthrough.windows.check.install": "Controllare l'installazione di MSVC digitando {0} in {1}. Verranno visualizzati un messaggio di copyright, la versione e la descrizione sulla sintassi di base.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Per usare MSVC dalla riga di comando o da VS Code, è necessario eseguire l'applicazione da {0}. Con una shell normale, ad esempio {1}, {2} o il prompt dei comandi di Windows le variabili di ambiente del percorso necessarie non sono impostate." + "walkthrough.windows.check.install": "Controllare l'installazione di MSVC digitando {0} in {1}. Verranno visualizzati un messaggio di copyright, la versione e la descrizione sulla sintassi di base." } \ No newline at end of file diff --git a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index c42c1c745..79390e5ab 100644 --- a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Verifica dell'installazione del compilatore", "walkthrough.windows.open.command.prompt": "Aprire {0} digitando '{1}' nel menu Start di Windows.", "walkthrough.windows.check.install": "Controllare l'installazione di MSVC digitando {0} in {1}. Verranno visualizzati un messaggio di copyright, la versione e la descrizione sulla sintassi di base.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Per usare MSVC dalla riga di comando o da VS Code, è necessario eseguire l'applicazione da {0}. Con una shell normale, ad esempio {1}, {2} o il prompt dei comandi di Windows le variabili di ambiente del percorso necessarie non sono impostate.", "walkthrough.windows.other.compilers": "Altre opzioni del compilatore", "walkthrough.windows.text3": "Se la destinazione è Linux da Windows, vedere {0}. In alternativa, è possibile {1}.", "walkthrough.windows.link.title1": "Uso di C++ e del sottosistema Windows per Linux (WSL) in VS Code", diff --git a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index c42c1c745..79390e5ab 100644 --- a/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/ita/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Verifica dell'installazione del compilatore", "walkthrough.windows.open.command.prompt": "Aprire {0} digitando '{1}' nel menu Start di Windows.", "walkthrough.windows.check.install": "Controllare l'installazione di MSVC digitando {0} in {1}. Verranno visualizzati un messaggio di copyright, la versione e la descrizione sulla sintassi di base.", - "walkthrough.windows.note2": "Nota", - "walkthrough.windows.note2.text": "Per usare MSVC dalla riga di comando o da VS Code, è necessario eseguire l'applicazione da {0}. Con una shell normale, ad esempio {1}, {2} o il prompt dei comandi di Windows le variabili di ambiente del percorso necessarie non sono impostate.", "walkthrough.windows.other.compilers": "Altre opzioni del compilatore", "walkthrough.windows.text3": "Se la destinazione è Linux da Windows, vedere {0}. In alternativa, è possibile {1}.", "walkthrough.windows.link.title1": "Uso di C++ e del sottosistema Windows per Linux (WSL) in VS Code", diff --git a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index ee850c771..40fde9ea0 100644 --- a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "メモ", "walkthrough.windows.note1.text": "有効な Visual Studio ライセンス (Community、Pro、Enterprise のいずれか) があり、その C++ コードベースの開発に積極的に使用している場合は、Visual Studio Build Tools の C++ ツールセットを Visual Studio Code と合わせて使用して、C++ コードベースのコンパイル、ビルド、および検証を行うことができます。", "walkthrough.windows.open.command.prompt": "Windows スタート メニューで '{1}' と入力して、{0} を開きます。", - "walkthrough.windows.check.install": "{1} に「{0}」と入力して、MSVC のインストールを確認します。バージョンと基本的な使用法の説明とともに、著作権に関するメッセージが表示されます。", - "walkthrough.windows.note2": "メモ", - "walkthrough.windows.note2.text": "コマンド ラインまたは VS Code で MSVC を使用するには、{0} で実行する必要があります。{1}、{2}、Windows コマンド プロンプトなどの通常のシェルには、必要なパス環境変数が設定されていません。" + "walkthrough.windows.check.install": "{1} に「{0}」と入力して、MSVC のインストールを確認します。バージョンと基本的な使用法の説明とともに、著作権に関するメッセージが表示されます。" } \ No newline at end of file diff --git a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 9a2619694..e7b81a046 100644 --- a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "コンパイラのインストールの確認中", "walkthrough.windows.open.command.prompt": "Windows スタート メニューで '{1}' と入力して、{0} を開きます。", "walkthrough.windows.check.install": "{1} に「{0}」と入力して、MSVC のインストールを確認します。バージョンと基本的な使用法の説明とともに、著作権に関するメッセージが表示されます。", - "walkthrough.windows.note2": "メモ", - "walkthrough.windows.note2.text": "コマンド ラインまたは VS Code で MSVC を使用するには、{0} で実行する必要があります。{1}、{2}、Windows コマンド プロンプトなどの通常のシェルには、必要なパス環境変数が設定されていません。", "walkthrough.windows.other.compilers": "その他のコンパイラ オプション", "walkthrough.windows.text3": "Windows から Linux に貼り付ける場合は、{0} をチェックしてください。あるいは、{1} も使用できます。", "walkthrough.windows.link.title1": "VS Code で C++ と Windows Subsystem for Linux (WSL) を使用する", diff --git a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 9a2619694..e7b81a046 100644 --- a/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/jpn/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "コンパイラのインストールの確認中", "walkthrough.windows.open.command.prompt": "Windows スタート メニューで '{1}' と入力して、{0} を開きます。", "walkthrough.windows.check.install": "{1} に「{0}」と入力して、MSVC のインストールを確認します。バージョンと基本的な使用法の説明とともに、著作権に関するメッセージが表示されます。", - "walkthrough.windows.note2": "メモ", - "walkthrough.windows.note2.text": "コマンド ラインまたは VS Code で MSVC を使用するには、{0} で実行する必要があります。{1}、{2}、Windows コマンド プロンプトなどの通常のシェルには、必要なパス環境変数が設定されていません。", "walkthrough.windows.other.compilers": "その他のコンパイラ オプション", "walkthrough.windows.text3": "Windows から Linux に貼り付ける場合は、{0} をチェックしてください。あるいは、{1} も使用できます。", "walkthrough.windows.link.title1": "VS Code で C++ と Windows Subsystem for Linux (WSL) を使用する", diff --git a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 4cc263fbb..24b85fa8b 100644 --- a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "메모", "walkthrough.windows.note1.text": "현재 C++ 코드베이스를 개발하는 데 적극적으로 사용 중인 유효한 Visual Studio 라이선스(Community, Pro 또는 Enterprise)가 있는 한 Visual Studio Build Tools의 C++ 도구 집합을 Visual Studio Code와 함께 사용하여 모든 C++ 코드베이스를 컴파일, 빌드 및 확인할 수 있습니다.", "walkthrough.windows.open.command.prompt": "Windows 시작 메뉴에 '{1}'을(를) 입력하여 {0}을(를) 엽니다.", - "walkthrough.windows.check.install": "{1}에 {0}을(를) 입력하여 MSVC 설치를 확인하세요. 버전 및 기본 사용 설명과 함께 저작권 메시지가 표시될 것입니다.", - "walkthrough.windows.note2": "메모", - "walkthrough.windows.note2.text": "명령줄 또는 VS Code에서 MSVC를 사용하려면 {0}에서 실행해야 합니다. {1}, {2} 또는 Windows 명령 프롬프트와 같은 일반 셸에는 필요한 경로 환경 변수가 설정되어 있지 않습니다." + "walkthrough.windows.check.install": "{1}에 {0}을(를) 입력하여 MSVC 설치를 확인하세요. 버전 및 기본 사용 설명과 함께 저작권 메시지가 표시될 것입니다." } \ No newline at end of file diff --git a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 92ae3c578..4c6d7803a 100644 --- a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "컴파일러 설치 확인 중", "walkthrough.windows.open.command.prompt": "Windows 시작 메뉴에 '{1}'을(를) 입력하여 {0}을(를) 엽니다.", "walkthrough.windows.check.install": "{1}에 {0}을(를) 입력하여 MSVC 설치를 확인하세요. 버전 및 기본 사용 설명과 함께 저작권 메시지가 표시될 것입니다.", - "walkthrough.windows.note2": "메모", - "walkthrough.windows.note2.text": "명령줄 또는 VS Code에서 MSVC를 사용하려면 {0}에서 실행해야 합니다. {1}, {2} 또는 Windows 명령 프롬프트와 같은 일반 셸에는 필요한 경로 환경 변수가 설정되어 있지 않습니다.", "walkthrough.windows.other.compilers": "기타 컴파일러 옵션", "walkthrough.windows.text3": "Windows에서 Linux를 대상으로 하는 경우 {0}을(를) 확인하세요. 또는 {1}할 수 있습니다.", "walkthrough.windows.link.title1": "VS Code에서 C++ 및 Linux용 Windows 하위 시스템(WSL) 사용", diff --git a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 92ae3c578..4c6d7803a 100644 --- a/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/kor/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "컴파일러 설치 확인 중", "walkthrough.windows.open.command.prompt": "Windows 시작 메뉴에 '{1}'을(를) 입력하여 {0}을(를) 엽니다.", "walkthrough.windows.check.install": "{1}에 {0}을(를) 입력하여 MSVC 설치를 확인하세요. 버전 및 기본 사용 설명과 함께 저작권 메시지가 표시될 것입니다.", - "walkthrough.windows.note2": "메모", - "walkthrough.windows.note2.text": "명령줄 또는 VS Code에서 MSVC를 사용하려면 {0}에서 실행해야 합니다. {1}, {2} 또는 Windows 명령 프롬프트와 같은 일반 셸에는 필요한 경로 환경 변수가 설정되어 있지 않습니다.", "walkthrough.windows.other.compilers": "기타 컴파일러 옵션", "walkthrough.windows.text3": "Windows에서 Linux를 대상으로 하는 경우 {0}을(를) 확인하세요. 또는 {1}할 수 있습니다.", "walkthrough.windows.link.title1": "VS Code에서 C++ 및 Linux용 Windows 하위 시스템(WSL) 사용", diff --git a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 891e84c91..600521a05 100644 --- a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Uwaga", "walkthrough.windows.note1.text": "Zestawu narzędzi języka C++ z narzędzi Visual Studio Build Tools wraz z programem Visual Studio Code można używać do kompilowania, tworzenia i weryfikowania dowolnej bazy kodu języka C++, o ile masz również ważną licencję programu Visual Studio (Community, Pro lub Enterprise), której aktywnie używasz do opracowywania tej bazy kodu języka C++.", "walkthrough.windows.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows.", - "walkthrough.windows.check.install": "Sprawdź instalację MSVC, wpisując {0} w {1}. Powinien zostać wyświetlony komunikat o prawach autorskich z wersją i podstawowym opisem dotyczącym użycia.", - "walkthrough.windows.note2": "Uwaga", - "walkthrough.windows.note2.text": "Aby użyć programu MSVC z wiersza polecenia lub programu VS Code, należy uruchomić z {0}. Zwykła powłoka, taka jak {1}, {2} lub wiersz polecenia systemu Windows, nie ma ustawionych wymaganych zmiennych środowiskowych ścieżki." + "walkthrough.windows.check.install": "Sprawdź instalację MSVC, wpisując {0} w {1}. Powinien zostać wyświetlony komunikat o prawach autorskich z wersją i podstawowym opisem dotyczącym użycia." } \ No newline at end of file diff --git a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 211ffd2a0..ea6dd1c11 100644 --- a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Weryfikowanie instalacji kompilatora", "walkthrough.windows.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows.", "walkthrough.windows.check.install": "Sprawdź instalację MSVC, wpisując {0} w {1}. Powinien zostać wyświetlony komunikat o prawach autorskich z wersją i podstawowym opisem dotyczącym użycia.", - "walkthrough.windows.note2": "Notatka", - "walkthrough.windows.note2.text": "Aby użyć programu MSVC z wiersza polecenia lub programu VS Code, należy uruchomić z {0}. Zwykła powłoka, taka jak {1}, {2} lub wiersz polecenia systemu Windows, nie ma ustawionych wymaganych zmiennych środowiskowych ścieżki.", "walkthrough.windows.other.compilers": "Inne opcje kompilatora", "walkthrough.windows.text3": "Jeśli zamierzasz korzystać z systemu Linux z poziomu systemu Windows, sprawdź {0}. Możesz też {1}.", "walkthrough.windows.link.title1": "Używanie języka C++ i podsystemu Windows dla systemu Linux (WSL) w programie VS Code", diff --git a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 211ffd2a0..ea6dd1c11 100644 --- a/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/plk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Weryfikowanie instalacji kompilatora", "walkthrough.windows.open.command.prompt": "Otwórz pozycję {0}, wpisując „{1}” w menu Start systemu Windows.", "walkthrough.windows.check.install": "Sprawdź instalację MSVC, wpisując {0} w {1}. Powinien zostać wyświetlony komunikat o prawach autorskich z wersją i podstawowym opisem dotyczącym użycia.", - "walkthrough.windows.note2": "Notatka", - "walkthrough.windows.note2.text": "Aby użyć programu MSVC z wiersza polecenia lub programu VS Code, należy uruchomić z {0}. Zwykła powłoka, taka jak {1}, {2} lub wiersz polecenia systemu Windows, nie ma ustawionych wymaganych zmiennych środowiskowych ścieżki.", "walkthrough.windows.other.compilers": "Inne opcje kompilatora", "walkthrough.windows.text3": "Jeśli zamierzasz korzystać z systemu Linux z poziomu systemu Windows, sprawdź {0}. Możesz też {1}.", "walkthrough.windows.link.title1": "Używanie języka C++ i podsystemu Windows dla systemu Linux (WSL) w programie VS Code", diff --git a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 266c47a6e..3eb5241f5 100644 --- a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Observação", "walkthrough.windows.note1.text": "Você pode usar o conjunto de ferramentas C++ das Ferramentas de Build do Visual Studio junto com o Visual Studio Code para compilar, construir e verificar qualquer base de código C++, contanto que também tenha uma licença válida do Visual Studio (Community, Pro ou Enterprise) que esteja ativamente usando para desenvolver essa base de código C++.", "walkthrough.windows.open.command.prompt": "Abra o {0} digitando '{1}' no menu Iniciar do Windows.", - "walkthrough.windows.check.install": "Verifique sua instalação do MSVC digitando {0} no {1}. Você deverá ver uma mensagem de copyright com a versão e a descrição básica de uso.", - "walkthrough.windows.note2": "Observação", - "walkthrough.windows.note2.text": "Para usar o MSVC a partir da linha de comando ou Código VS, você deve executar a partir de um {0}. Um shell comum como {1}, {2} ou o prompt de comando do Windows não possui as variáveis ​​de ambiente de caminho necessárias definidas." + "walkthrough.windows.check.install": "Verifique sua instalação do MSVC digitando {0} no {1}. Você deverá ver uma mensagem de copyright com a versão e a descrição básica de uso." } \ No newline at end of file diff --git a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index d96d0bc9c..a750660fa 100644 --- a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Verificando a instalação do compilador", "walkthrough.windows.open.command.prompt": "Abra o {0} digitando '{1}' no menu Iniciar do Windows.", "walkthrough.windows.check.install": "Verifique sua instalação do MSVC digitando {0} no {1}. Você deverá ver uma mensagem de copyright com a versão e a descrição básica de uso.", - "walkthrough.windows.note2": "Observação", - "walkthrough.windows.note2.text": "Para usar o MSVC a partir da linha de comando ou Código VS, você deve executar a partir de um {0}. Um shell comum como {1}, {2} ou o prompt de comando do Windows não possui as variáveis ​​de ambiente de caminho necessárias definidas.", "walkthrough.windows.other.compilers": "Outras opções do compilador", "walkthrough.windows.text3": "Se você está segmentando o Linux a partir do Windows, verifique {0}. Ou você pode {1}.", "walkthrough.windows.link.title1": "Usando C++ e Subsistema Windows para Linux (WSL) no código VS", diff --git a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index d96d0bc9c..a750660fa 100644 --- a/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/ptb/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Verificando a instalação do compilador", "walkthrough.windows.open.command.prompt": "Abra o {0} digitando '{1}' no menu Iniciar do Windows.", "walkthrough.windows.check.install": "Verifique sua instalação do MSVC digitando {0} no {1}. Você deverá ver uma mensagem de copyright com a versão e a descrição básica de uso.", - "walkthrough.windows.note2": "Observação", - "walkthrough.windows.note2.text": "Para usar o MSVC a partir da linha de comando ou Código VS, você deve executar a partir de um {0}. Um shell comum como {1}, {2} ou o prompt de comando do Windows não possui as variáveis ​​de ambiente de caminho necessárias definidas.", "walkthrough.windows.other.compilers": "Outras opções do compilador", "walkthrough.windows.text3": "Se você está segmentando o Linux a partir do Windows, verifique {0}. Ou você pode {1}.", "walkthrough.windows.link.title1": "Usando C++ e Subsistema Windows para Linux (WSL) no código VS", diff --git a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 01693b4e8..3c1d19649 100644 --- a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Примечание", "walkthrough.windows.note1.text": "Вы можете использовать набор инструментов C++ из пакета Visual Studio Build Tools вместе с Visual Studio Code для компиляции, сборки и проверки любой базы кода C++, если у вас есть действующая лицензия Visual Studio (Community, Pro или Enterprise), которой вы активно пользуетесь для разработки этой базы кода C++.", "walkthrough.windows.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows.", - "walkthrough.windows.check.install": "Проверьте установку MSVC, введя \"{0}\" в {1}. Должно появиться сообщение об авторских правах с номером версии и кратким описанием использования.", - "walkthrough.windows.note2": "Примечание", - "walkthrough.windows.note2.text": "Чтобы использовать MSVC из командной строки или VS Code, требуется запуск из {0}. В обычной среде, например в {1}, в {2} или в командной строке Windows, не заданы необходимые переменные среды \"path\"." + "walkthrough.windows.check.install": "Проверьте установку MSVC, введя \"{0}\" в {1}. Должно появиться сообщение об авторских правах с номером версии и кратким описанием использования." } \ No newline at end of file diff --git a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index 9671f9cf6..14a8f0565 100644 --- a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Проверка установки компилятора", "walkthrough.windows.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows.", "walkthrough.windows.check.install": "Проверьте установку MSVC, введя \"{0}\" в {1}. Должно появиться сообщение об авторских правах с номером версии и кратким описанием использования.", - "walkthrough.windows.note2": "Примечание", - "walkthrough.windows.note2.text": "Чтобы использовать MSVC из командной строки или VS Code, требуется запуск из {0}. В обычной среде, например в {1}, в {2} или в командной строке Windows, не заданы необходимые переменные среды \"path\".", "walkthrough.windows.other.compilers": "Другие параметры компилятора", "walkthrough.windows.text3": "Если вы нацеливаетесь на Linux из Windows, ознакомьтесь с {0}. Также вы можете {1}.", "walkthrough.windows.link.title1": "Использование C++ и подсистемы Windows для Linux в VS Code", diff --git a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index 9671f9cf6..14a8f0565 100644 --- a/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/rus/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Проверка установки компилятора", "walkthrough.windows.open.command.prompt": "Откройте {0}, введя \"{1}\" в меню \"Пуск\" в Windows.", "walkthrough.windows.check.install": "Проверьте установку MSVC, введя \"{0}\" в {1}. Должно появиться сообщение об авторских правах с номером версии и кратким описанием использования.", - "walkthrough.windows.note2": "Примечание", - "walkthrough.windows.note2.text": "Чтобы использовать MSVC из командной строки или VS Code, требуется запуск из {0}. В обычной среде, например в {1}, в {2} или в командной строке Windows, не заданы необходимые переменные среды \"path\".", "walkthrough.windows.other.compilers": "Другие параметры компилятора", "walkthrough.windows.text3": "Если вы нацеливаетесь на Linux из Windows, ознакомьтесь с {0}. Также вы можете {1}.", "walkthrough.windows.link.title1": "Использование C++ и подсистемы Windows для Linux в VS Code", diff --git a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json index 69029f98d..4b3ebac19 100644 --- a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows.md.i18n.json @@ -17,7 +17,5 @@ "walkthrough.windows.note1": "Not", "walkthrough.windows.note1.text": "Herhangi bir C++ kod temelini derlemek, oluşturmak ve doğrulamak için Visual Studio Code ile birlikte Visual Studio Derleme Araçları’nda bulunan C++ araç takımını kullanabilirsiniz. Bunun yanı sıra, bu C++ kod temelini geliştirmek için etkin olarak kullandığınız geçerli bir Visual Studio lisansına (Community, Pro veya Enterprise) sahip olursunuz.", "walkthrough.windows.open.command.prompt": "Windows Başlat menüsüne '{1}' yazarak {0} öğesini açın.", - "walkthrough.windows.check.install": "{1} içine {0} yazarak MSVC yüklemenizi kontrol edin. Sürüm ve temel kullanım açıklamasını içeren bir telif hakkı iletisi göreceksiniz.", - "walkthrough.windows.note2": "Not", - "walkthrough.windows.note2.text": "Komut satırından veya VS Code’dan MSVC’yi kullanmak için şuradan çalıştırmanız gerek: {0}. {1}, {2} veya Windows komut istemi gibi sıradan bir kabuk gerekli yol ortam değişkenleri kümesi içermez." + "walkthrough.windows.check.install": "{1} içine {0} yazarak MSVC yüklemenizi kontrol edin. Sürüm ve temel kullanım açıklamasını içeren bir telif hakkı iletisi göreceksiniz." } \ No newline at end of file diff --git a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json index ac14715c5..274017de0 100644 --- a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows10.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Derleyici yüklemesi doğrulanıyor", "walkthrough.windows.open.command.prompt": "Windows Başlat menüsüne '{1}' yazarak {0} öğesini açın.", "walkthrough.windows.check.install": "{1} içine {0} yazarak MSVC yüklemenizi kontrol edin. Sürüm ve temel kullanım açıklamasını içeren bir telif hakkı iletisi göreceksiniz.", - "walkthrough.windows.note2": "Not", - "walkthrough.windows.note2.text": "Komut satırından veya VS Code’dan MSVC’yi kullanmak için şuradan çalıştırmanız gerek: {0}. {1}, {2} veya Windows komut istemi gibi sıradan bir kabuk gerekli yol ortam değişkenleri kümesi içermez.", "walkthrough.windows.other.compilers": "Diğer derleme seçenekleri", "walkthrough.windows.text3": "Windows'tan Linux'u hedefliyorsanız {0}‘a bakın. Veya, {1}.", "walkthrough.windows.link.title1": "VS Code'da Linux için C++’yı ve Windows Alt Sistemi’ni (WSL) kullanma", diff --git a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json index ac14715c5..274017de0 100644 --- a/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json +++ b/Extension/i18n/trk/walkthrough/installcompiler/install-compiler-windows11.md.i18n.json @@ -12,8 +12,6 @@ "walkthrough.windows.verify.compiler": "Derleyici yüklemesi doğrulanıyor", "walkthrough.windows.open.command.prompt": "Windows Başlat menüsüne '{1}' yazarak {0} öğesini açın.", "walkthrough.windows.check.install": "{1} içine {0} yazarak MSVC yüklemenizi kontrol edin. Sürüm ve temel kullanım açıklamasını içeren bir telif hakkı iletisi göreceksiniz.", - "walkthrough.windows.note2": "Not", - "walkthrough.windows.note2.text": "Komut satırından veya VS Code’dan MSVC’yi kullanmak için şuradan çalıştırmanız gerek: {0}. {1}, {2} veya Windows komut istemi gibi sıradan bir kabuk gerekli yol ortam değişkenleri kümesi içermez.", "walkthrough.windows.other.compilers": "Diğer derleme seçenekleri", "walkthrough.windows.text3": "Windows'tan Linux'u hedefliyorsanız {0}‘a bakın. Veya, {1}.", "walkthrough.windows.link.title1": "VS Code'da Linux için C++’yı ve Windows Alt Sistemi’ni (WSL) kullanma", From 7bb4c513d20d64668a79bde182c6535162a76b65 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 29 Oct 2025 15:02:48 -0700 Subject: [PATCH 30/30] support for arm64 native tools --- Extension/package.json | 2 +- Extension/src/LanguageServer/devcmd.ts | 9 +++++---- Extension/yarn.lock | 14 ++++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 565bd1c0d..cfca95777 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6793,7 +6793,7 @@ "node-fetch": "^2.7.0", "node-loader": "^2.0.0", "node-stream-zip": "^1.15.0", - "node-vcvarsall": "^1.1.1", + "node-vcvarsall": "^1.2.0", "node-vswhere": "^1.0.2", "plist": "^3.1.0", "posix-getopt": "^1.2.1", diff --git a/Extension/src/LanguageServer/devcmd.ts b/Extension/src/LanguageServer/devcmd.ts index e282a1016..baa097430 100644 --- a/Extension/src/LanguageServer/devcmd.ts +++ b/Extension/src/LanguageServer/devcmd.ts @@ -89,7 +89,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) { const host = vars['VSCMD_ARG_HOST_ARCH']; const target = vars['VSCMD_ARG_TGT_ARCH']; const arch = vcvars.getArchitecture({ - host: match(host, { 'x86': 'x86', 'x64': 'x64' }) ?? 'x64', + host: match(host, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'arm64' }) ?? 'x64', target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64' }); const settings = new CppSettings(); @@ -109,7 +109,8 @@ async function getVSInstallations() { all: true, prerelease: true, sort: true, - requires: ['Microsoft.VisualStudio.Component.VC.Tools.x86.x64'] + requires: ['Microsoft.VisualStudio.Component.VC.Tools.x86.x64', 'Microsoft.VisualStudio.Component.VC.Tools.ARM64'], + requiresAny: true }); if (installations.length === 0) { @@ -217,9 +218,9 @@ async function getHostsAndTargets(vcPath: string): Promise } const hostTargets: vcvars.HostTarget[] = []; for (const host of hosts) { - const h = match<'x86' | 'x64' | undefined>(host.toLowerCase(), { 'hostx86': 'x86', 'hostx64': 'x64' }); + const h = match<'x86' | 'x64' | 'arm64' | undefined>(host.toLowerCase(), { 'hostx86': 'x86', 'hostx64': 'x64', 'hostarm64': 'arm64' }); if (!h) { - // skip any arm/arm64 folders because there is no arm compiler + // skip any non-matching folders continue; } const targets = await fs.readdir(path.join(vcPath, host)); diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 0c1e524a3..c3429357f 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3559,12 +3559,13 @@ node-stream-zip@^1.15.0: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-stream-zip/-/node-stream-zip-1.15.0.tgz#158adb88ed8004c6c49a396b50a6a5de3bca33ea" integrity sha1-FYrbiO2ABMbEmjlrUKal3jvKM+o= -node-vcvarsall@^1.1.1: - version "1.1.1" - resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.1.1.tgz#ec10a9fafcc7fd4033f716f82a04a2a5a13e1a62" - integrity sha1-7BCp+vzH/UAz9xb4KgSipaE+GmI= +node-vcvarsall@^1.2.0: + version "1.2.0" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/node-vcvarsall/-/node-vcvarsall-1.2.0.tgz#995a5a8e49467f9c45ed83a71c1aa45adb44421a" + integrity sha1-mVpajklGf5xF7YOnHBqkWttEQho= dependencies: node-vswhere "^1.0.2" + semver "^7.7.3" tmp "^0.2.5" node-vswhere@^1.0.2: @@ -4246,6 +4247,11 @@ semver@^7.3.4, semver@^7.3.7, semver@^7.5.4, semver@^7.6.2, semver@^7.6.3: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" integrity sha1-q9UJjYKxjGyB9gdP8mR/0+ciDJ8= +semver@^7.7.3: + version "7.7.3" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" + integrity sha1-S19BQ9AHYzqNxnHNCm75FHuLuUY= + serialize-javascript@^6.0.2: version "6.0.2" resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2"