Skip to content

Commit

Permalink
Merge #19
Browse files Browse the repository at this point in the history
19: Revert "Support homedir references (`~` or `$HOME`) in runtimeExecutable config" r=Yatekii a=dbrgn

As discussed in #18, this reverts commit 4f5e410.

Instead of using `~` or `$HOME`, the variable `${env:HOME}` should be used, as it's the official way of referencing the home dir: https://code.visualstudio.com/docs/editor/variables-reference#_environment-variables

Co-authored-by: Danilo Bargen <mail@dbrgn.ch>
  • Loading branch information
bors[bot] and dbrgn authored Nov 11, 2021
2 parents b6726fc + bd4d1b0 commit 700083f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
33 changes: 13 additions & 20 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@

import * as child_process from 'child_process';
import * as os from 'os';
import * as path from 'path';

import * as vscode from 'vscode';
import { DebugAdapterTracker, DebugAdapterTrackerFactory } from 'vscode';

import { replaceHome } from './utils';
import { DebugAdapterTracker, DebugAdapterTrackerFactory, } from 'vscode';

// This is just the default. It will be updated after the configuration has been resolved.
var probeRsLogLevel = 'Info';
Expand Down Expand Up @@ -224,24 +220,21 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD
env: { ...process.env, 'RUST_LOG': logEnv, },
};

let command;
if (executable) {
var command = "";
if (!executable) {
if (session.configuration.hasOwnProperty('runtimeExecutable')) {
command = session.configuration.runtimeExecutable;
} else {
switch (os.platform()) {
case 'win32': command = "probe-rs-debugger.exe"; break;
default: command = "probe-rs-debugger";
}
}
}
else {
command = executable.command;
} else if (session.configuration.hasOwnProperty('runtimeExecutable')) {
command = replaceHome(session.configuration.runtimeExecutable);
} else {
switch (os.platform()) {
case 'win32':
command = "probe-rs-debugger.exe";
break;
default:
command = "probe-rs-debugger";
}
}

// Because it's easier to debug, resolve the potentially relative path to an absolute path
command = path.resolve(options.cwd, command)

// The debug adapter process was launched by VSCode, and should terminate itself at the end of every debug session (when receiving `Disconnect` or `Terminate` Request from VSCode). The "false"(default) state of this option implies that the process was launched (and will be managed) by the user.
args.push("--vscode");

Expand Down
12 changes: 0 additions & 12 deletions src/utils.ts

This file was deleted.

0 comments on commit 700083f

Please sign in to comment.