From b247437aece010a44341b91d51fa933c93d044ed Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Tue, 9 Feb 2021 21:05:54 +0100 Subject: [PATCH] Small fixes to #85, thanks a lot @clayreimann! --- .vscode/launch.json | 2 +- CHANGELOG.md | 5 +++++ README.md | 1 + package.json | 2 +- src/toolchain/SwiftTools.ts | 4 +++- src/vscode/config-helpers.ts | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5dec183..55804c7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -98,7 +98,7 @@ "port": 6004, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/out/src/server/**/*.js" + "${workspaceRoot}/out/sourcekites-server/**/*.js" ] } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d70299..cc0590a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Allow lang server restart #82 #85 by @clayreinann +- Commands for stop, clean and run #82 #85 by @clayreimann + ## 2.10.1 - Did not respect default toolchain path diff --git a/README.md b/README.md index b57a814..a5dbf2f 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Though in most cases sourcekit-lsp and sourcekite should produce better results ## Contributors - Valentin Knabel, [@vknabel](https://github.com/vknabel), [twitter](https://twitter.com/vknabel), _maintainer_ +- Clay Jensen-Reimann, [@clayreimann](https://github.com/clayreimann), [twitter](https://twitter.com/clayreimann) - Jin Mingjian, [@JinMingjian](https://github.com/JinMingjian), [twitter](https://twitter.com/JinMingjian), _author_, not involved anymore - Felix Fischer, [@felix91gr](https://github.com/felix91gr), [twitter](https://twitter.com/FelixFischer91) - Mijo Gračanin, [@mijo-gracanin](https://github.com/mijo-gracanin) diff --git a/package.json b/package.json index 4246c0e..74e011e 100644 --- a/package.json +++ b/package.json @@ -259,7 +259,7 @@ "vscode:prepublish": "npm run build", "build": "npm run compile", "compile": "npx tsc", - "format": "npx prettier CHANGELOG.md README.md src/*.ts src/server/**/*.ts tsconfig.json --write", + "format": "npx prettier CHANGELOG.md README.md src/*.ts src/sourcekites-server/**/*.ts tsconfig.json --write", "test": "npx jest" }, "devDependencies": { diff --git a/src/toolchain/SwiftTools.ts b/src/toolchain/SwiftTools.ts index dd0b667..bfef18d 100644 --- a/src/toolchain/SwiftTools.ts +++ b/src/toolchain/SwiftTools.ts @@ -127,7 +127,9 @@ export class Toolchain { if (target) { buildArgs.unshift(target); } - buildArgs.unshift("build"); + if (!["build", "test"].includes(buildArgs[0])) { + buildArgs.unshift("build"); + } statusBarItem.start(); try { const { proc, output: buildOutput } = this.spawnSwiftProc(buildArgs, output.build, code => { diff --git a/src/vscode/config-helpers.ts b/src/vscode/config-helpers.ts index 0fd199e..aed2d69 100644 --- a/src/vscode/config-helpers.ts +++ b/src/vscode/config-helpers.ts @@ -42,7 +42,7 @@ export function isLSPTracingOn(): boolean { */ export function sourcekiteServerOptions(context: ExtensionContext): ServerOptions { // The server is implemented in node - const serverModule = context.asAbsolutePath(path.join("out/src/sourcekites-server", "server.js")); + const serverModule = context.asAbsolutePath(path.join("out/sourcekites-server", "server.js")); // The debug options for the server const debugOptions = { execArgv: ["--nolazy", "--inspect=6004"],