From 0ee12079bce0850a02d41d369795702ba69a709c Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 28 Apr 2020 20:15:52 +0200 Subject: [PATCH 1/2] Rebuild rust-analyzer when launching in VS Code --- .vscode/launch.json | 4 ++-- .vscode/tasks.json | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 3f74d75666..408f8d580d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,7 +41,7 @@ "outFiles": [ "${workspaceFolder}/editors/code/out/**/*.js" ], - "preLaunchTask": "Build Extension", + "preLaunchTask": "Build Server", "skipFiles": [ "/**/*.js" ], @@ -62,7 +62,7 @@ "outFiles": [ "${workspaceFolder}/editors/code/out/**/*.js" ], - "preLaunchTask": "Build Extension", + "preLaunchTask": "Build Server (Release)", "skipFiles": [ "/**/*.js" ], diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4037e7cce1..922f66d808 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -22,5 +22,12 @@ "command": "cargo build --package rust-analyzer", "problemMatcher": "$rustc" }, + { + "label": "Build Server (Release)", + "group": "build", + "type": "shell", + "command": "cargo build --release --package rust-analyzer", + "problemMatcher": "$rustc" + }, ] } From 61c28c2b22207c14c1e74687ae49a9beab6e4206 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 28 Apr 2020 22:32:23 +0200 Subject: [PATCH 2/2] Build extension too --- .vscode/launch.json | 4 ++-- .vscode/tasks.json | 24 +++++++++++++++++++++++- editors/code/package.json | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 408f8d580d..6a2fff9065 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,7 +41,7 @@ "outFiles": [ "${workspaceFolder}/editors/code/out/**/*.js" ], - "preLaunchTask": "Build Server", + "preLaunchTask": "Build Server and Extension", "skipFiles": [ "/**/*.js" ], @@ -62,7 +62,7 @@ "outFiles": [ "${workspaceFolder}/editors/code/out/**/*.js" ], - "preLaunchTask": "Build Server (Release)", + "preLaunchTask": "Build Server (Release) and Extension", "skipFiles": [ "/**/*.js" ], diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 922f66d808..0969ce89a1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ "version": "2.0.0", "tasks": [ { - "label": "Build Extension", + "label": "Build Extension in Background", "group": "build", "type": "npm", "script": "watch", @@ -15,6 +15,17 @@ }, "isBackground": true, }, + { + "label": "Build Extension", + "group": "build", + "type": "npm", + "script": "build", + "path": "editors/code/", + "problemMatcher": { + "base": "$tsc", + "fileLocation": ["relative", "${workspaceFolder}/editors/code/"] + }, + }, { "label": "Build Server", "group": "build", @@ -29,5 +40,16 @@ "command": "cargo build --release --package rust-analyzer", "problemMatcher": "$rustc" }, + + { + "label": "Build Server and Extension", + "dependsOn": ["Build Server", "Build Extension"], + "problemMatcher": "$rustc" + }, + { + "label": "Build Server (Release) and Extension", + "dependsOn": ["Build Server (Release)", "Build Extension"], + "problemMatcher": "$rustc" + } ] } diff --git a/editors/code/package.json b/editors/code/package.json index b8aaa07d87..c4dfa7e13d 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -27,6 +27,7 @@ "scripts": { "vscode:prepublish": "tsc && rollup -c", "package": "vsce package -o rust-analyzer.vsix", + "build": "tsc", "watch": "tsc --watch", "lint": "tsfmt --verify && eslint -c .eslintrc.js --ext ts ./src", "fix": " tsfmt -r && eslint -c .eslintrc.js --ext ts ./src --fix"