diff options
| author | Emil Lauridsen <mine809@gmail.com> | 2019-12-25 16:44:42 +0100 |
|---|---|---|
| committer | Emil Lauridsen <mine809@gmail.com> | 2019-12-25 17:37:40 +0100 |
| commit | 41a1ec723ce2ea3fa78ae468830f0a77e5658307 (patch) | |
| tree | 7a5d9d2ba86e37734ef5dc4c87fb40148c764c53 /editors/code/src/utils | |
| parent | 66e8ef53a0ed018d03340577a0443030a193f773 (diff) | |
| download | rust-41a1ec723ce2ea3fa78ae468830f0a77e5658307.tar.gz rust-41a1ec723ce2ea3fa78ae468830f0a77e5658307.zip | |
Remove cargo-watch from vscode extension.
Still keeps tests around for reference when porting them to rust
Diffstat (limited to 'editors/code/src/utils')
| -rw-r--r-- | editors/code/src/utils/processes.ts | 51 | ||||
| -rw-r--r-- | editors/code/src/utils/terminateProcess.sh | 12 |
2 files changed, 0 insertions, 63 deletions
diff --git a/editors/code/src/utils/processes.ts b/editors/code/src/utils/processes.ts deleted file mode 100644 index a1d6b7eafbc..00000000000 --- a/editors/code/src/utils/processes.ts +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -import * as cp from 'child_process'; -import ChildProcess = cp.ChildProcess; - -import { join } from 'path'; - -const isWindows = process.platform === 'win32'; -const isMacintosh = process.platform === 'darwin'; -const isLinux = process.platform === 'linux'; - -// this is very complex, but is basically copy-pased from VSCode implementation here: -// https://github.com/Microsoft/vscode-languageserver-node/blob/dbfd37e35953ad0ee14c4eeced8cfbc41697b47e/client/src/utils/processes.ts#L15 - -// And see discussion at -// https://github.com/rust-analyzer/rust-analyzer/pull/1079#issuecomment-478908109 - -export function terminate(process: ChildProcess, cwd?: string): boolean { - if (isWindows) { - try { - // This we run in Atom execFileSync is available. - // Ignore stderr since this is otherwise piped to parent.stderr - // which might be already closed. - const options: any = { - stdio: ['pipe', 'pipe', 'ignore'], - }; - if (cwd) { - options.cwd = cwd; - } - cp.execFileSync( - 'taskkill', - ['/T', '/F', '/PID', process.pid.toString()], - options, - ); - return true; - } catch (err) { - return false; - } - } else if (isLinux || isMacintosh) { - try { - const cmd = join(__dirname, 'terminateProcess.sh'); - const result = cp.spawnSync(cmd, [process.pid.toString()]); - return result.error ? false : true; - } catch (err) { - return false; - } - } else { - process.kill('SIGKILL'); - return true; - } -} diff --git a/editors/code/src/utils/terminateProcess.sh b/editors/code/src/utils/terminateProcess.sh deleted file mode 100644 index 2ec9e1c2ec3..00000000000 --- a/editors/code/src/utils/terminateProcess.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -terminateTree() { - for cpid in $(pgrep -P $1); do - terminateTree $cpid - done - kill -9 $1 > /dev/null 2>&1 -} - -for pid in $*; do - terminateTree $pid -done \ No newline at end of file |
