Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25d74973b0 | ||
|
|
adf99597f6 | ||
|
|
52fe7952d6 | ||
|
|
aa4c5df4b7 | ||
|
|
a3de2f9bee | ||
|
|
28f6dd66d2 | ||
|
|
89fd6a960c | ||
|
|
8b06e7d04f | ||
|
|
b1021432ec | ||
|
|
2cca514128 | ||
|
|
2e33027272 | ||
|
|
73a0b95df7 | ||
|
|
39f32a3b45 | ||
|
|
16f352169c | ||
|
|
adff6e66d5 | ||
|
|
1877aed36a | ||
|
|
49d9cfd5ee | ||
|
|
6867272d06 | ||
|
|
890dae3a87 | ||
|
|
9a7fa21028 |
@@ -1,5 +1,22 @@
|
||||
# C/C++ for Visual Studio Code Change Log
|
||||
|
||||
## Version 1.1.3: December 3, 2020
|
||||
### Bug Fixes
|
||||
* Disable the "join Insiders" prompt for Linux CodeSpaces. [#6491](https://github.com/microsoft/vscode-cpptools/issues/6491)
|
||||
* Fix "shell" tasks giving error "Cannot read property `includes` of undefined". [#6538](https://github.com/microsoft/vscode-cpptools/issues/6538)
|
||||
* Fix various task variables not getting resolved with `cppbuild` tasks. [#6538](https://github.com/microsoft/vscode-cpptools/issues/6538)
|
||||
* Fix warnings not appearing with `cppbuild` tasks. [#6556](https://github.com/microsoft/vscode-cpptools/issues/6556)
|
||||
* Fix endless CPU/memory usage if the cpptools process crashes. [#6603](https://github.com/microsoft/vscode-cpptools/issues/6603)
|
||||
* Fix the default `cwd` for `cppbuild` tasks. [#6618](https://github.com/microsoft/vscode-cpptools/issues/6618)
|
||||
|
||||
## Version 1.1.2: November 17, 2020
|
||||
### Bug Fix
|
||||
* Fix resolution of `${fileDirname}` with `cppbuild` tasks. [#6386](https://github.com/microsoft/vscode-cpptools/issues/6386)
|
||||
|
||||
## Version 1.1.1: November 9, 2020
|
||||
### Bug Fixes
|
||||
* Fix cpptools binaries sometimes not getting installed on Windows. [#6453](https://github.com/microsoft/vscode-cpptools/issues/6453)
|
||||
|
||||
## Version 1.1.0: November 5, 2020
|
||||
### New Features
|
||||
* Add language server support for Windows ARM64 (no debugging yet). [#5583](https://github.com/microsoft/vscode-cpptools/issues/5583)
|
||||
|
||||
+608
-286
File diff suppressed because it is too large
Load Diff
@@ -4,5 +4,5 @@
|
||||
"recursiveIncludes": 100,
|
||||
"gotoDefIntelliSense": 100,
|
||||
"enhancedColorization": 100,
|
||||
"minimumVSCodeVersion": "1.44.0"
|
||||
"minimumVSCodeVersion": "1.49.0"
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "生成和调试活动文件",
|
||||
"cannot.build.non.cpp": "无法生成和调试,因为活动文件不是 C 或 C++ 源文件。",
|
||||
"no.compiler.found": "未找到编译程序",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "选择配置",
|
||||
"cl.exe.not.available": "仅当从 VS 开发人员命令提示符处运行 VS Code 时,{0} 生成和调试才可用。"
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "建置及偵錯使用中的檔案",
|
||||
"cannot.build.non.cpp": "因為作用中的檔案不是 C 或 C++ 來源檔案,所以無法建立和偵錯。",
|
||||
"no.compiler.found": "找不到任何編譯器",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "選取組態",
|
||||
"cl.exe.not.available": "只有從 VS 的開發人員命令提示字元執行 VS Code 時,才可使用 {0} 組建和偵錯。"
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Sestavit a ladit aktivní soubor",
|
||||
"cannot.build.non.cpp": "Sestavení a ladění není možné, protože aktivní soubor není zdrojový soubor jazyka C ani C++.",
|
||||
"no.compiler.found": "Nenašel se žádný kompilátor.",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Vybrat konfiguraci",
|
||||
"cl.exe.not.available": "Sestavení a ladění {0} je k dispozici jen v případě, že se nástroj VS Code spustil z nástroje Developer Command Prompt pro VS."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Aktive Datei erstellen und debuggen",
|
||||
"cannot.build.non.cpp": "Erstellen und Debuggen nicht möglich, da die aktive Datei keine C- oder C++-Quelldatei ist.",
|
||||
"no.compiler.found": "Kein Compiler gefunden.",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Konfiguration auswählen",
|
||||
"cl.exe.not.available": "{0}-Build und -Debuggen können nur verwendet werden, wenn VS Code von der Developer-Eingabeaufforderung für VS ausgeführt wird."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Compilar y depurar el archivo activo",
|
||||
"cannot.build.non.cpp": "No se puede compilar y depurar código porque el archivo activo no es un archivo de código fuente de C o C++.",
|
||||
"no.compiler.found": "No se encontró ningún compilador",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Seleccionar una configuración",
|
||||
"cl.exe.not.available": "La compilación y depuración de {0} solo se puede usar cuando VS Code se ejecuta desde el Símbolo del sistema para desarrolladores de Visual Studio."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Générer et déboguer le fichier actif",
|
||||
"cannot.build.non.cpp": "Génération et débogage impossibles, car le fichier actif n'est pas un fichier source C ou C++.",
|
||||
"no.compiler.found": "Aucun compilateur",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Sélectionner une configuration",
|
||||
"cl.exe.not.available": "La génération et le débogage de {0} peuvent être utilisés uniquement quand VS Code est exécuté à partir de l'invite de commandes développeur pour VS."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Compila ed esegui il debug del file attivo",
|
||||
"cannot.build.non.cpp": "Non è possibile compilare ed eseguire il debug perché il file attivo non è un file di origine C o C++.",
|
||||
"no.compiler.found": "Non è stato trovato alcun compilatore",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Seleziona una configurazione",
|
||||
"cl.exe.not.available": "La compilazione e il debug di {0} sono utilizzabili solo quando VS Code viene eseguito da Prompt dei comandi per gli sviluppatori per Visual Studio."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "アクティブ ファイルのビルドとデバッグ",
|
||||
"cannot.build.non.cpp": "アクティブ ファイルが C または C++ ソース ファイルではないため、ビルドおよびデバッグできません。",
|
||||
"no.compiler.found": "コンパイラが見つかりませんでした",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "構成の選択",
|
||||
"cl.exe.not.available": "{0} のビルドとデバッグを使用できるのは、VS 用開発者コマンド プロンプトから VS Code を実行する場合のみです。"
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "활성 파일 빌드 및 디버그",
|
||||
"cannot.build.non.cpp": "활성 파일이 C 또는 C++ 소스 파일이 아니므로 빌드 및 디버그할 수 없습니다.",
|
||||
"no.compiler.found": "컴파일러를 찾을 수 없음",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "구성 선택",
|
||||
"cl.exe.not.available": "{0} 빌드 및 디버그는 VS의 개발자 명령 프롬프트에서 VS Code를 실행하는 경우에만 사용할 수 있습니다."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Kompiluj i debuguj aktywny plik",
|
||||
"cannot.build.non.cpp": "Nie można skompilować i debugować, ponieważ aktywny plik nie jest plikiem źródłowym języka C lub C++.",
|
||||
"no.compiler.found": "Nie znaleziono kompilatora",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Wybierz konfigurację",
|
||||
"cl.exe.not.available": "{0} — funkcji kompilacji i debugowania można używać tylko wtedy, gdy program VS Code został uruchomiony z wiersza polecenia dla deweloperów w programie VS."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Criar e depurar o arquivo ativo",
|
||||
"cannot.build.non.cpp": "Não é possível criar e depurar porque o arquivo ativo não é um arquivo de origem C ou C++.",
|
||||
"no.compiler.found": "Nenhum compilador encontrado",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Selecionar uma configuração",
|
||||
"cl.exe.not.available": "A criação e a depuração de {0} só podem ser usadas quando o VS Code é executado por meio do Prompt de Comando do Desenvolvedor para VS."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Сборка и отладка активного файла",
|
||||
"cannot.build.non.cpp": "Не удается выполнить сборку и отладку, так как активный файл не является исходным файлом C или C++.",
|
||||
"no.compiler.found": "Компилятор не найден",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Выберите конфигурацию.",
|
||||
"cl.exe.not.available": "Сборку и отладку {0} можно использовать только при запуске VS Code из Командной строки разработчика для VS."
|
||||
}
|
||||
@@ -7,6 +7,6 @@
|
||||
"build.and.debug.active.file": "Etkin dosyayı derle ve dosyada hata ayıkla",
|
||||
"cannot.build.non.cpp": "Etkin dosya bir C ya da C++ kaynak dosyası olmadığından derleme veya hata ayıklama yapılamıyor.",
|
||||
"no.compiler.found": "Derleyici bulunamadı",
|
||||
"select.configuration": "Select a configuration",
|
||||
"select.configuration": "Yapılandırma seçin",
|
||||
"cl.exe.not.available": "{0} derlemesi ve hata ayıklama yalnızca VS Code, VS için Geliştirici Komut İstemi'nden çalıştırıldığında kullanılabilir."
|
||||
}
|
||||
+9
-13
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.3",
|
||||
"publisher": "ms-vscode",
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
"readme": "README.md",
|
||||
@@ -2347,7 +2347,7 @@
|
||||
"@types/plist": "^3.0.2",
|
||||
"@types/semver": "^7.1.0",
|
||||
"@types/tmp": "^0.1.0",
|
||||
"@types/vscode": "1.44.0",
|
||||
"@types/vscode": "1.49.0",
|
||||
"@types/webpack": "^4.39.0",
|
||||
"@types/which": "^1.3.2",
|
||||
"@types/yauzl": "^2.9.1",
|
||||
@@ -2419,7 +2419,7 @@
|
||||
"linux"
|
||||
],
|
||||
"architectures": [
|
||||
"x86_64"
|
||||
"x64"
|
||||
],
|
||||
"binaries": [
|
||||
"./bin/cpptools",
|
||||
@@ -2476,10 +2476,8 @@
|
||||
"win32"
|
||||
],
|
||||
"architectures": [
|
||||
"x86_64",
|
||||
"x86",
|
||||
"i686",
|
||||
"i386"
|
||||
"x64",
|
||||
"x86"
|
||||
],
|
||||
"binaries": [
|
||||
"./bin/cpptools.exe",
|
||||
@@ -2509,7 +2507,7 @@
|
||||
"linux"
|
||||
],
|
||||
"architectures": [
|
||||
"x86_64"
|
||||
"x64"
|
||||
],
|
||||
"binaries": [
|
||||
"./LLVM/bin/clang-format"
|
||||
@@ -2583,7 +2581,7 @@
|
||||
"linux"
|
||||
],
|
||||
"architectures": [
|
||||
"x86_64"
|
||||
"x64"
|
||||
],
|
||||
"binaries": [
|
||||
"./debugAdapters/mono.linux-x86_64"
|
||||
@@ -2665,10 +2663,8 @@
|
||||
"win32"
|
||||
],
|
||||
"architectures": [
|
||||
"x86_64",
|
||||
"x86",
|
||||
"i686",
|
||||
"i386"
|
||||
"x64",
|
||||
"x86"
|
||||
],
|
||||
"binaries": [
|
||||
"./debugAdapters/vsdbg/bin/vsdbg.exe"
|
||||
|
||||
@@ -150,12 +150,16 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
}
|
||||
// Filter out build tasks that don't match the currently selected debug configuration type.
|
||||
buildTasks = buildTasks.filter((task: CppBuildTask) => {
|
||||
const command: string = task.definition.command as string;
|
||||
if (!command) {
|
||||
return false;
|
||||
}
|
||||
if (defaultConfig.name.startsWith("(Windows) ")) {
|
||||
if ((task.definition.command as string).includes("cl.exe")) {
|
||||
if (command.includes("cl.exe")) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (!(task.definition.command as string).includes("cl.exe")) {
|
||||
if (!command.includes("cl.exe")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -174,10 +178,13 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
newConfig.preLaunchTask = task.name;
|
||||
newConfig.externalConsole = false;
|
||||
const exeName: string = path.join("${fileDirname}", "${fileBasenameNoExtension}");
|
||||
newConfig.program = platform === "win32" ? exeName + ".exe" : exeName;
|
||||
const isWindows: boolean = platform === 'win32';
|
||||
newConfig.program = isWindows ? exeName + ".exe" : exeName;
|
||||
// Add the "detail" property to show the compiler path in QuickPickItem.
|
||||
// This property will be removed before writing the DebugConfiguration in launch.json.
|
||||
newConfig.detail = task.detail ? task.detail : definition.command;
|
||||
const isCl: boolean = compilerName === "cl.exe";
|
||||
newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(compilerPath) ? path.dirname(compilerPath) : "${workspaceFolder}";
|
||||
|
||||
return new Promise<vscode.DebugConfiguration>(resolve => {
|
||||
if (platform === "darwin") {
|
||||
@@ -197,7 +204,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
debuggerName = "gdb";
|
||||
}
|
||||
|
||||
if (platform === "win32") {
|
||||
if (isWindows) {
|
||||
debuggerName += ".exe";
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export function initialize(context: vscode.ExtensionContext): void {
|
||||
// Not enabled because we do not react to single-file mode correctly yet.
|
||||
// We get an ENOENT when the user's c_cpp_properties.json is attempted to be parsed.
|
||||
// The DefaultClient will also have its configuration accessed, but since it doesn't exist it errors out.
|
||||
vscode.window.showErrorMessage('This command is not yet available for single-file mode.');
|
||||
vscode.window.showErrorMessage(localize("single_file_mode_not_available", "This command is not available for single-file mode."));
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,11 @@ export class ClientCollection {
|
||||
}
|
||||
|
||||
public forEach(callback: (client: cpptools.Client) => void): void {
|
||||
this.languageClients.forEach(callback);
|
||||
// Copy this.languageClients to languageClients to avoid an infinite foreach loop
|
||||
// when callback modifies this.languageClients (e.g. when cpptools crashes).
|
||||
const languageClients: cpptools.Client[] = [];
|
||||
this.languageClients.forEach(client => languageClients.push(client));
|
||||
languageClients.forEach(callback);
|
||||
}
|
||||
|
||||
public checkOwnership(client: cpptools.Client, document: vscode.TextDocument): boolean {
|
||||
|
||||
@@ -246,7 +246,9 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
private onConfigurationsChanged(): void {
|
||||
this.configurationsChanged.fire(this.Configurations);
|
||||
if (this.Configurations) {
|
||||
this.configurationsChanged.fire(this.Configurations);
|
||||
}
|
||||
}
|
||||
|
||||
private onSelectionChanged(): void {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
import * as path from 'path';
|
||||
import {
|
||||
TaskDefinition, Task, TaskGroup, WorkspaceFolder, ShellExecution, Uri, workspace,
|
||||
TaskDefinition, Task, TaskGroup, ShellExecution, Uri, workspace,
|
||||
TaskProvider, TaskScope, CustomExecution, ProcessExecution, TextEditor, Pseudoterminal, EventEmitter, Event, TerminalDimensions, window
|
||||
} from 'vscode';
|
||||
import * as os from 'os';
|
||||
@@ -15,6 +15,10 @@ import * as configs from './configurations';
|
||||
import * as ext from './extension';
|
||||
import * as cp from "child_process";
|
||||
import { OtherSettings } from './settings';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
export interface CppBuildTaskDefinition extends TaskDefinition {
|
||||
type: string;
|
||||
@@ -156,14 +160,14 @@ export class CppBuildTaskProvider implements TaskProvider {
|
||||
|
||||
if (!definition) {
|
||||
const taskLabel: string = ((appendSourceToName && !compilerPathBase.startsWith(CppBuildTaskProvider.CppBuildSourceStr)) ?
|
||||
CppBuildTaskProvider.CppBuildSourceStr + ": " : "") + compilerPathBase + " build active file";
|
||||
CppBuildTaskProvider.CppBuildSourceStr + ": " : "") + compilerPathBase + " " + localize("build_active_file", "build active file");
|
||||
const filePath: string = path.join('${fileDirname}', '${fileBasenameNoExtension}');
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let args: string[] = isCl ? ['/Zi', '/EHsc', '/Fe:', filePath + '.exe', '${file}'] : ['-g', '${file}', '-o', filePath + (isWindows ? '.exe' : '')];
|
||||
if (compilerArgs && compilerArgs.length > 0) {
|
||||
args = args.concat(compilerArgs);
|
||||
}
|
||||
const cwd: string = isCl ? "${workspaceFolder}" : path.dirname(compilerPath);
|
||||
const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(compilerPath) ? path.dirname(compilerPath) : "${workspaceFolder}";
|
||||
const options: cp.ExecOptions | undefined = { cwd: cwd };
|
||||
definition = {
|
||||
type: CppBuildTaskProvider.CppBuildScriptType,
|
||||
@@ -185,13 +189,13 @@ export class CppBuildTaskProvider implements TaskProvider {
|
||||
|
||||
const scope: TaskScope = TaskScope.Workspace;
|
||||
const task: CppBuildTask = new Task(definition, scope, definition.label, CppBuildTaskProvider.CppBuildSourceStr,
|
||||
new CustomExecution(async (): Promise<Pseudoterminal> =>
|
||||
new CustomExecution(async (resolvedDefinition: TaskDefinition): Promise<Pseudoterminal> =>
|
||||
// When the task is executed, this callback will run. Here, we setup for running the task.
|
||||
new CustomBuildTaskTerminal(resolvedcompilerPath, definition ? definition.args : [], definition ? definition.options : undefined)
|
||||
new CustomBuildTaskTerminal(resolvedcompilerPath, resolvedDefinition.args, resolvedDefinition.options)
|
||||
), isCl ? '$msCompile' : '$gcc');
|
||||
|
||||
task.group = TaskGroup.Build;
|
||||
task.detail = detail ? detail : "compiler: " + resolvedcompilerPath;
|
||||
task.detail = detail ? detail : localize("compiler_details", "compiler:") + " " + resolvedcompilerPath;
|
||||
|
||||
return task;
|
||||
};
|
||||
@@ -200,6 +204,9 @@ export class CppBuildTaskProvider implements TaskProvider {
|
||||
const rawJson: any = await this.getRawTasksJson();
|
||||
const rawTasksJson: any = (!rawJson.tasks) ? new Array() : rawJson.tasks;
|
||||
const buildTasksJson: CppBuildTask[] = rawTasksJson.map((task: any) => {
|
||||
if (!task.label) {
|
||||
return null;
|
||||
}
|
||||
const definition: CppBuildTaskDefinition = {
|
||||
type: task.type,
|
||||
label: task.label,
|
||||
@@ -211,7 +218,7 @@ export class CppBuildTaskProvider implements TaskProvider {
|
||||
cppBuildTask.detail = task.detail;
|
||||
return cppBuildTask;
|
||||
});
|
||||
return buildTasksJson;
|
||||
return buildTasksJson.filter((task: CppBuildTask) => task !== null);
|
||||
}
|
||||
|
||||
public async ensureBuildTaskExists(taskLabel: string): Promise<void> {
|
||||
@@ -252,7 +259,7 @@ export class CppBuildTaskProvider implements TaskProvider {
|
||||
...selectedTask.definition,
|
||||
problemMatcher: selectedTask.problemMatchers,
|
||||
group: { kind: "build", "isDefault": true },
|
||||
detail: "Generated task by Debugger"
|
||||
detail: localize("task_generated_by_debugger", "Task generated by Debugger.")
|
||||
};
|
||||
rawTasksJson.tasks.push(newTask);
|
||||
}
|
||||
@@ -333,7 +340,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
|
||||
async open(_initialDimensions: TerminalDimensions | undefined): Promise<void> {
|
||||
telemetry.logLanguageServerEvent("cppBuildTaskStarted");
|
||||
// At this point we can start using the terminal.
|
||||
this.writeEmitter.fire(`Starting build...${this.endOfLine}`);
|
||||
this.writeEmitter.fire(localize("starting_build", "Starting build...") + this.endOfLine);
|
||||
await this.doBuild();
|
||||
}
|
||||
|
||||
@@ -343,16 +350,16 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
|
||||
|
||||
private async doBuild(): Promise<any> {
|
||||
// Do build.
|
||||
let activeCommand: string = util.resolveVariables(this.command, this.AdditionalEnvironment);
|
||||
let activeCommand: string = util.resolveVariables(this.command);
|
||||
this.args.forEach(value => {
|
||||
let temp: string = util.resolveVariables(value, this.AdditionalEnvironment);
|
||||
let temp: string = util.resolveVariables(value);
|
||||
if (temp && temp.includes(" ")) {
|
||||
temp = "\"" + temp + "\"";
|
||||
}
|
||||
activeCommand = activeCommand + " " + temp;
|
||||
});
|
||||
if (this.options?.cwd) {
|
||||
this.options.cwd = util.resolveVariables(this.options.cwd, this.AdditionalEnvironment);
|
||||
this.options.cwd = util.resolveVariables(this.options.cwd);
|
||||
}
|
||||
|
||||
const splitWriteEmitter = (lines: string | Buffer) => {
|
||||
@@ -363,16 +370,34 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
|
||||
try {
|
||||
const result: number = await new Promise<number>((resolve, reject) => {
|
||||
cp.exec(activeCommand, this.options, (_error, stdout, _stderr) => {
|
||||
const dot: string = (stdout || _stderr) ? ":" : ".";
|
||||
if (_error) {
|
||||
telemetry.logLanguageServerEvent("cppBuildTaskError");
|
||||
const dot: string = (stdout || _stderr) ? ":" : ".";
|
||||
this.writeEmitter.fire(`Build finished with error${dot}${this.endOfLine}`);
|
||||
splitWriteEmitter(stdout);
|
||||
splitWriteEmitter(_stderr);
|
||||
this.writeEmitter.fire(localize("build_finished_with_error", "Build finished with errors(s)") + dot + this.endOfLine);
|
||||
if (stdout) {
|
||||
splitWriteEmitter(stdout); // cl.exe
|
||||
} else if (_stderr) {
|
||||
splitWriteEmitter(_stderr); // gcc/clang
|
||||
} else {
|
||||
splitWriteEmitter(_error.message); // e.g. command executable not found
|
||||
}
|
||||
resolve(-1);
|
||||
} else {
|
||||
return;
|
||||
} else if (_stderr && !stdout) { // gcc/clang
|
||||
telemetry.logLanguageServerEvent("cppBuildTaskWarnings");
|
||||
this.writeEmitter.fire(localize("build_finished_with_warnings", "Build finished with warning(s)") + dot + this.endOfLine);
|
||||
splitWriteEmitter(_stderr);
|
||||
resolve(0);
|
||||
} else if (stdout && stdout.includes("warning C")) { // cl.exe
|
||||
telemetry.logLanguageServerEvent("cppBuildTaskWarnings");
|
||||
this.writeEmitter.fire(localize("build_finished_with_warnings", "Build finished with warning(s)") + dot + this.endOfLine);
|
||||
splitWriteEmitter(stdout);
|
||||
this.writeEmitter.fire(`Build finished successfully.${this.endOfLine}`);
|
||||
resolve(0);
|
||||
} else {
|
||||
if (stdout) {
|
||||
splitWriteEmitter(stdout); // cl.exe
|
||||
}
|
||||
this.writeEmitter.fire(localize("build finished successfully", "Build finished successfully.") + this.endOfLine);
|
||||
resolve(0);
|
||||
}
|
||||
});
|
||||
@@ -382,23 +407,4 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
|
||||
this.closeEmitter.fire(-1);
|
||||
}
|
||||
}
|
||||
|
||||
private get AdditionalEnvironment(): { [key: string]: string | string[] } | undefined {
|
||||
const editor: TextEditor | undefined = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return undefined;
|
||||
}
|
||||
const fileDir: WorkspaceFolder | undefined = workspace.getWorkspaceFolder(editor.document.uri);
|
||||
if (!fileDir) {
|
||||
window.showErrorMessage('This command is not yet available for single-file mode.');
|
||||
return undefined;
|
||||
}
|
||||
const file: string = editor.document.fileName;
|
||||
return {
|
||||
"file": file,
|
||||
"fileDirname": fileDir.uri.fsPath,
|
||||
"fileBasenameNoExtension": path.parse(file).name,
|
||||
"workspaceFolder": fileDir.uri.fsPath
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,8 +276,8 @@ function sendActivationTelemetry(): void {
|
||||
}
|
||||
machineIdPersistentState.Value = vscode.env.machineId;
|
||||
}
|
||||
if (vscode.env.remoteName) {
|
||||
activateEvent["remoteName"] = vscode.env.remoteName;
|
||||
if (vscode.env.uiKind === vscode.UIKind.Web) {
|
||||
activateEvent["WebUI"] = "1";
|
||||
}
|
||||
telemetry.logLanguageServerEvent("Activate", activateEvent);
|
||||
}
|
||||
@@ -332,7 +332,7 @@ function realActivation(): void {
|
||||
|
||||
PlatformInformation.GetPlatformInformation().then(info => {
|
||||
// Skip Insiders processing for 32-bit Linux.
|
||||
if (info.platform !== "linux" || info.architecture === "x86_64" || info.architecture === "arm" || info.architecture === "arm64") {
|
||||
if (info.platform !== "linux" || info.architecture === "x64" || info.architecture === "arm" || info.architecture === "arm64") {
|
||||
// Skip Insiders processing for unsupported VS Code versions.
|
||||
const vscodeVersion: PackageVersion = new PackageVersion(vscode.version);
|
||||
const abTestSettings: ABTestSettings = getABTestSettings();
|
||||
|
||||
@@ -13,8 +13,8 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
export class ReferencesTreeDataProvider implements vscode.TreeDataProvider<TreeNode> {
|
||||
private referencesModel: ReferencesModel | undefined;
|
||||
private readonly _onDidChangeTreeData = new vscode.EventEmitter<TreeNode>();
|
||||
readonly onDidChangeTreeData: vscode.Event<TreeNode>;
|
||||
private readonly _onDidChangeTreeData = new vscode.EventEmitter<void>();
|
||||
readonly onDidChangeTreeData: vscode.Event<void>;
|
||||
|
||||
constructor() {
|
||||
this.onDidChangeTreeData = this._onDidChangeTreeData.event;
|
||||
|
||||
@@ -103,6 +103,7 @@ export class ABTestSettings {
|
||||
let hasError: boolean = false;
|
||||
const telemetryProperties: { [key: string]: string } = {};
|
||||
const localConfigPath: string = util.getExtensionFilePath(localConfigFile);
|
||||
// Download the latest cpptools.json.
|
||||
return util.downloadFileToDestination("https://go.microsoft.com/fwlink/?linkid=2097702", localConfigPath)
|
||||
.catch((error) => {
|
||||
// More specific error info is not likely to be helpful, and we get detailed download data from the initial install.
|
||||
|
||||
@@ -116,17 +116,15 @@ export function vsixNameForPlatform(info: PlatformInformation): string {
|
||||
switch (platformInfo.platform) {
|
||||
case 'win32':
|
||||
switch (platformInfo.architecture) {
|
||||
case 'x86_64': return 'cpptools-win32.vsix'; // TODO: Change to cpptools-win64?
|
||||
case 'x86':
|
||||
case 'i386':
|
||||
case 'i686': return 'cpptools-win32.vsix';
|
||||
case 'x64': return 'cpptools-win32.vsix'; // TODO: Change to cpptools-win64?
|
||||
case 'x86': return 'cpptools-win32.vsix';
|
||||
case 'arm64': return 'cpptools-win-arm64.vsix';
|
||||
default: throw new Error(`Unexpected Windows architecture: ${platformInfo.architecture}`);
|
||||
}
|
||||
case 'darwin': return 'cpptools-osx.vsix';
|
||||
default: {
|
||||
switch (platformInfo.architecture) {
|
||||
case 'x86_64': return 'cpptools-linux.vsix';
|
||||
case 'x64': return 'cpptools-linux.vsix';
|
||||
case 'arm': return 'cpptools-linux-armhf.vsix';
|
||||
case 'arm64': return 'cpptools-linux-aarch64.vsix';
|
||||
default: throw new Error(`Unexpected Linux architecture: ${platformInfo.architecture}`);
|
||||
|
||||
@@ -35,8 +35,9 @@ const disposables: vscode.Disposable[] = [];
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<CppToolsApi & CppToolsExtension> {
|
||||
let errMsg: string = "";
|
||||
if (process.arch !== 'x64' && (process.platform !== 'win32' || (process.arch !== 'ia32' && process.arch !== 'arm64')) && (process.platform !== 'linux' || (process.arch !== 'x64' && process.arch !== 'arm' && process.arch !== 'arm64' && process.arch !== 'aarch64'))) {
|
||||
errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(process.arch));
|
||||
const arch: string = os.arch();
|
||||
if (arch !== 'x64' && (process.platform !== 'win32' || (arch !== 'ia32' && arch !== 'arm64')) && (process.platform !== 'linux' || (arch !== 'x64' && arch !== 'arm' && arch !== 'arm64'))) {
|
||||
errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(arch));
|
||||
} else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
|
||||
errMsg = localize("apline.containers.not.supported", "Alpine containers are not supported.");
|
||||
}
|
||||
@@ -372,7 +373,8 @@ function sendTelemetry(info: PlatformInformation): boolean {
|
||||
util.setProgress(util.getProgressInstallSuccess());
|
||||
}
|
||||
|
||||
installBlob.telemetryProperties['osArchitecture'] = info.architecture ?? "";
|
||||
installBlob.telemetryProperties['osArchitecture'] = os.arch();
|
||||
installBlob.telemetryProperties['infoArchitecture'] = info.architecture;
|
||||
|
||||
Telemetry.logDebuggerEvent("acquisition", installBlob.telemetryProperties);
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@ export function VersionsMatch(pkg: IPackage, info: PlatformInformation): boolean
|
||||
}
|
||||
|
||||
export function ArchitecturesMatch(value: IPackage, info: PlatformInformation): boolean {
|
||||
return !value.architectures || (info.architecture !== undefined && value.architectures.indexOf(info.architecture) !== -1);
|
||||
return !value.architectures || (value.architectures.indexOf(info.architecture) !== -1);
|
||||
}
|
||||
|
||||
export function PlatformsMatch(value: IPackage, info: PlatformInformation): boolean {
|
||||
|
||||
+21
-46
@@ -4,7 +4,6 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import * as os from 'os';
|
||||
import * as util from './common';
|
||||
import { LinuxDistribution } from './linuxDistribution';
|
||||
import * as plist from 'plist';
|
||||
import * as fs from 'fs';
|
||||
@@ -24,26 +23,23 @@ export function GetOSName(processPlatform: string | undefined): string | undefin
|
||||
}
|
||||
|
||||
export class PlatformInformation {
|
||||
constructor(public platform: string, public architecture?: string, public distribution?: LinuxDistribution, public version?: string) { }
|
||||
constructor(public platform: string, public architecture: string, public distribution?: LinuxDistribution, public version?: string) { }
|
||||
|
||||
public static GetPlatformInformation(): Promise<PlatformInformation> {
|
||||
const platform: string = os.platform();
|
||||
let architecturePromise: Promise<string | undefined>;
|
||||
const architecture: string = PlatformInformation.GetArchitecture();
|
||||
let distributionPromise: Promise<LinuxDistribution | undefined> = Promise.resolve<LinuxDistribution | undefined>(undefined);
|
||||
let versionPromise: Promise<string | undefined> = Promise.resolve<string | undefined>(undefined);
|
||||
|
||||
switch (platform) {
|
||||
case "win32":
|
||||
architecturePromise = PlatformInformation.GetWindowsArchitecture();
|
||||
break;
|
||||
|
||||
case "linux":
|
||||
architecturePromise = PlatformInformation.GetUnixArchitecture();
|
||||
distributionPromise = LinuxDistribution.GetDistroInformation();
|
||||
break;
|
||||
|
||||
case "darwin":
|
||||
architecturePromise = PlatformInformation.GetUnixArchitecture();
|
||||
versionPromise = PlatformInformation.GetDarwinVersion();
|
||||
break;
|
||||
|
||||
@@ -51,50 +47,29 @@ export class PlatformInformation {
|
||||
throw new Error(localize("unknown.os.platform", "Unknown OS platform"));
|
||||
}
|
||||
|
||||
return Promise.all([architecturePromise, distributionPromise, versionPromise])
|
||||
.then(([arch, distro, version]) =>
|
||||
new PlatformInformation(platform, arch, distro, version)
|
||||
return Promise.all([distributionPromise, versionPromise])
|
||||
.then(([distro, version]) =>
|
||||
new PlatformInformation(platform, architecture, distro, version)
|
||||
);
|
||||
}
|
||||
|
||||
public static GetUnknownArchitecture(): string { return "Unknown"; }
|
||||
|
||||
private static GetWindowsArchitecture(): Promise<string> {
|
||||
return util.execChildProcess('wmic os get osarchitecture', util.extensionPath)
|
||||
.then((architecture) => {
|
||||
if (architecture) {
|
||||
const archArray: string[] = architecture.split(os.EOL);
|
||||
if (archArray.length >= 2) {
|
||||
const arch: string = archArray[1].trim();
|
||||
|
||||
// Note: This string can be localized. So, we'll just check to see if it contains 32 or 64.
|
||||
if (arch.indexOf('64') >= 0) {
|
||||
if (arch.indexOf('ARM') >= 0) {
|
||||
return "arm64";
|
||||
}
|
||||
return "x86_64";
|
||||
} else if (arch.indexOf('32') >= 0) {
|
||||
return "x86";
|
||||
}
|
||||
}
|
||||
public static GetArchitecture(): string {
|
||||
const arch: string = os.arch();
|
||||
switch (arch) {
|
||||
case "x64":
|
||||
case "arm64":
|
||||
case "arm":
|
||||
return arch;
|
||||
case "x32":
|
||||
case "ia32":
|
||||
return "x86";
|
||||
default:
|
||||
if (os.platform() === "win32") {
|
||||
return "x86";
|
||||
} else {
|
||||
return "x64";
|
||||
}
|
||||
return PlatformInformation.GetUnknownArchitecture();
|
||||
}).catch((error) => PlatformInformation.GetUnknownArchitecture());
|
||||
}
|
||||
|
||||
private static GetUnixArchitecture(): Promise<string | undefined> {
|
||||
return util.execChildProcess('uname -m', util.packageJson.extensionFolderPath)
|
||||
.then((architecture) => {
|
||||
if (architecture) {
|
||||
if (architecture.startsWith('arm64') || architecture.startsWith('aarch64')) {
|
||||
return 'arm64';
|
||||
} else if (architecture.startsWith('armv')) {
|
||||
return 'arm';
|
||||
}
|
||||
return architecture.trim();
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static GetDarwinVersion(): Promise<string> {
|
||||
|
||||
+4
-4
@@ -204,10 +204,10 @@
|
||||
dependencies:
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@types/[email protected]4.0":
|
||||
version "1.44.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.44.0.tgz#62ecfe3d0e38942fce556574da54ee1013c775b7"
|
||||
integrity sha512-WJZtZlinE3meRdH+I7wTsIhpz/GLhqEQwmPGeh4s1irWLwMzCeTV8WZ+pgPTwrDXoafVUWwo1LiZ9HJVHFlJSQ==
|
||||
"@types/[email protected]9.0":
|
||||
version "1.49.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.49.0.tgz#f3731d97d7e8b2697510eb26f6e6d04ee8c17352"
|
||||
integrity sha512-wfNQmLmm1VdMBr6iuNdprWmC1YdrgZ9dQzadv+l2eSjJlElOdJw8OTm4RU4oGTBcfvG6RZI2jOcppkdSS18mZw==
|
||||
|
||||
"@types/webpack-sources@*":
|
||||
version "0.1.6"
|
||||
|
||||
Reference in New Issue
Block a user