Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Fix variable reference bug in package.json for new vscode engine #435

Merged
merged 1 commit into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
"name": "Arduino",
"type": "arduino",
"request": "launch",
"program": "$${{file}}",
"cwd": "$${{workspaceFolder}}",
"program": "^\"\\${file}\"",
"cwd": "^\"\\${workspaceFolder}\"",
"MIMode": "gdb",
"targetArchitecture": "arm",
"miDebuggerPath": "",
Expand All @@ -155,7 +155,7 @@
"text": "target remote localhost:3333"
},
{
"text": "file $${{file}}"
"text": "^\"file \\${file}\""
},
{
"text": "load"
Expand Down
30 changes: 18 additions & 12 deletions src/debug/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,27 @@ export class ArduinoDebugConfigurationProvider implements vscode.DebugConfigurat

public provideDebugConfigurations(folder: vscode.WorkspaceFolder | undefined, token?: vscode.CancellationToken):
vscode.ProviderResult<vscode.DebugConfiguration[]> {
return [{
return [
this.getDefaultDebugSettings(folder),
];
}

// Try to add all missing attributes to the debug configuration being launched.
public resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken):
vscode.ProviderResult<vscode.DebugConfiguration> {
if (!config || !config.request) {
config = this.getDefaultDebugSettings(folder);
}
return this.resolveDebugConfigurationAsync(config);
}

private getDefaultDebugSettings(folder: vscode.WorkspaceFolder | undefined) {
return {
name: "Arduino",
type: "arduino",
request: "launch",
program: "${file}",
cwd: folder,
cwd: "${workspaceFolder}",
MIMode: "gdb",
targetArchitecture: "arm",
miDebuggerPath: "",
Expand Down Expand Up @@ -53,16 +68,7 @@ export class ArduinoDebugConfigurationProvider implements vscode.DebugConfigurat
launchCompleteCommand: "exec-continue",
filterStderr: true,
args: [],
}];
}

// Try to add all missing attributes to the debug configuration being launched.
public resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken):
vscode.ProviderResult<vscode.DebugConfiguration> {
if (config && !config.cwd) {
config.cwd = folder;
}
return this.resolveDebugConfigurationAsync(config);
};
}

private async resolveDebugConfigurationAsync(config: vscode.DebugConfiguration) {
Expand Down