Skip to content

Commit

Permalink
[debugger] fix current target triplet is not added in remote step (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBoosY authored Apr 9, 2024
1 parent 9dffad5 commit eb8f35f
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 7 deletions.
170 changes: 170 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
13 changes: 12 additions & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...');
Expand Down
8 changes: 4 additions & 4 deletions src/vcpkgDebugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class VcpkgDebugger {
private tasksJsonFileName = "tasks";
private launchJsonFileName = "launch";

private _defaultTripket = "";
private _defaultTriplet = "";

private _logMgr : VcpkgLogMgr;

Expand Down Expand Up @@ -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;
}
Expand All @@ -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()
Expand Down

0 comments on commit eb8f35f

Please sign in to comment.