From eb8f35f0c426a8122d9aa9fa1a718acc4e4520ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:23:11 +0800 Subject: [PATCH] [debugger] fix current target triplet is not added in remote step (#14) --- VERSION.md | 170 +++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- src/configuration.ts | 13 +++- src/extension.ts | 2 +- src/vcpkgDebugger.ts | 8 +- 5 files changed, 188 insertions(+), 7 deletions(-) create mode 100644 VERSION.md diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..e97f2d2 --- /dev/null +++ b/VERSION.md @@ -0,0 +1,170 @@ +# History + +## 2.2.1 +Bug fixes: + +- Fix target triplet is not added into debugger remove config. +- Fix set target triplet cannot update debugger config. + + +## 2.2.0 +Features: + +- Support to debug port's CMake code. + +Bug fixes: + +- Fix some exceptions when setting / getting triplet. + + +## 2.1.0 +Features: + +- Now extension can support debug portfile and vcpkg-owned cmake code. + + +## 2.0.8 +Bug fixes: + +- Fix some bugs. + + +## 2.0.7 +Improvements: + +- set host and target triplets use select box. + + +## 2.0.6 +Features: + +- Add an option to automatically update your host/target triplet according to your os. +- Add new commands to set your host/target triplet. + +Improvements: + +- Now plugin will notify with a message window when getting port history versions. + + +## 2.0.3 +Bug fixes: + +- Correct the builtin-baseline value. + + +## 2.0.2 +Bug fixes: + +- fix bug. + + +## 2.0.1 +Bug fixes: + +- bug fix. + + +## 2.0.0 +Features: + +- version and builtin-baseline autocompletion in vcpkg manifest + + +## 1.0.4 +Features: + +- Add option asset source +- Add option binary source + + +## 1.0.3 +Improvements: + +- Improve jugdment whether vcpkg root is valid. + +Bug fixes: + +- Fix bug whe checking vcpkg root + + +## 1.0.2 +Bug fixes: + +- fix circle enable-disable vcpkg when delete vcpkg path in settings + +Improvements: + +- Add more details in readme + + +## 1.0.1 +Features: + +- Add getting start page + + +## 1.0.0 +The release version is published now! + +Bug fixes: + +- change manifest and installDeps to target +- remove installDir option +- add preferSysLib option + + +## 0.2.2 +Bug fixes: + +- Manifest mode only can be enabled when vcpkg is enabled + + +## 0.2.1 +Features: + +- Add CRT Linkage option + + +## 0.1.3 +Improvements: + +- Now all settings will be synced in workspace settings +- Vcpkg path can be set only once on the same machine + + +## 0.1.2 +Bug fixes: + +- Fix target triplet can't be syncd when using dynamic lib + + +## 0.1.1 +Bug fixes: + +- Fix vcpkg path is invalid on non-Windows + +Improvments: + +- Add guide for VCPKG_INSTALL_OPTIONS + + +## 0.1.0 +Features: + +- Support non-Windows + +Bug fixes: + +- Fix the problem of changing settings without responding + + +## 0.0.4 +Features: + +- Add VCPKG_INSTALL_OPTIONS support + + +## 0.0.3 +Features: + +- Basic function for enable/disable integration, set dynamic/static library. diff --git a/package.json b/package.json index 9443549..ba39b64 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "icon": "images/vcpkg-logo.png", "publisher": "JackBoosY", "license": "MIT", - "version": "2.2.0", + "version": "2.2.1", "engines": { "vscode": "^1.76.0" }, diff --git a/src/configuration.ts b/src/configuration.ts index 0d145c1..82135b3 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -5,12 +5,14 @@ import { workspace } from "vscode"; import * as proc from 'child_process'; import { VersionManager } from './versionManager'; import { VcpkgLogMgr } from './log'; +import {VcpkgDebugger} from './vcpkgDebugger'; export class ConfigurationManager implements vscode.Disposable { //private _context: vscode.ExtensionContext; private disposables: vscode.Disposable[] = []; private _logMgr : VcpkgLogMgr; + private _vcpkgDebugger: VcpkgDebugger; private _versionMgr : VersionManager; private _enableVcpkgConfig = 'general.enable'; @@ -46,10 +48,11 @@ export class ConfigurationManager implements vscode.Disposable private _cmakeOptionEanble = '=ON'; private _cmakeOptionDisable = '=OFF'; - constructor(/*context: vscode.ExtensionContext, */verMgr : VersionManager, logMgr : VcpkgLogMgr) { + constructor(/*context: vscode.ExtensionContext, */verMgr : VersionManager, logMgr : VcpkgLogMgr, vcpkgDebugger: VcpkgDebugger) { // this._context = context; this._logMgr = logMgr; this._versionMgr = verMgr; + this._vcpkgDebugger = vcpkgDebugger; let vcpkgPath= this.getVcpkgPathFromConfig(); if (vcpkgPath !== undefined) @@ -866,9 +869,17 @@ export class ConfigurationManager implements vscode.Disposable let result = await vscode.window.showQuickPick(triplets, {canPickMany: false, placeHolder: "Choose a triplet"}); if (result !== undefined) { + if (result.label === "") + { + vscode.window.showErrorMessage('Target triplet should not be empty string.'); + } this.updateVcpkgSetting(this._targetTripletConfig, result.label); this.logInfo('update target triplet to: ' + result.label); vscode.window.showInformationMessage('Update target triplet to: ' + result.label); + + // Update debugger configuration + this._vcpkgDebugger.setDefaultTriplet(result.label); + this._vcpkgDebugger.updateConfigurations(); } } diff --git a/src/extension.ts b/src/extension.ts index 90cabfe..e0722fb 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -23,8 +23,8 @@ export function activate(context: vscode.ExtensionContext) { logMgr = new VcpkgLogMgr(); verMgr = new VersionManager(); - configMgr = new ConfigurationManager(/*context, */verMgr, logMgr); vcpkgDebugger = new VcpkgDebugger(logMgr); + configMgr = new ConfigurationManager(/*context, */verMgr, logMgr, vcpkgDebugger); cmakeDbg = new CmakeDebugger(vcpkgDebugger, logMgr); configMgr.logInfo('Trying to active vcpkg plugin...'); diff --git a/src/vcpkgDebugger.ts b/src/vcpkgDebugger.ts index 14b8f12..036841d 100644 --- a/src/vcpkgDebugger.ts +++ b/src/vcpkgDebugger.ts @@ -6,7 +6,7 @@ export class VcpkgDebugger { private tasksJsonFileName = "tasks"; private launchJsonFileName = "launch"; - private _defaultTripket = ""; + private _defaultTriplet = ""; private _logMgr : VcpkgLogMgr; @@ -87,7 +87,7 @@ export class VcpkgDebugger { vscode.window.showErrorMessage("Current default triplet is empty! Please manually set first."); return false; } - this._defaultTripket = triplet; + this._defaultTriplet = triplet; return true; } @@ -106,8 +106,8 @@ export class VcpkgDebugger { exeSuffix = ".exe"; } - return "\"${workspaceFolder}/vcpkg" + exeSuffix + "\" remove " + modifiedPorts + " --recurse; & \"${workspaceFolder}/vcpkg"+ exeSuffix + "\" install " + modifiedPorts - + " --triplet " + this._defaultTripket + " --no-binarycaching --x-cmake-debug " + this.getDebuggerPipe(); + return "\"${workspaceFolder}/vcpkg" + exeSuffix + "\" remove " + modifiedPorts + " --triplet " + this._defaultTriplet + " --recurse; & \"${workspaceFolder}/vcpkg"+ exeSuffix + "\" install " + modifiedPorts + + " --triplet " + this._defaultTriplet + " --no-binarycaching --x-cmake-debug " + this.getDebuggerPipe(); } private async cleanConfigurations()