Skip to content

Commit 0d7c997

Browse files
Merge #4196
4196: Rebuild rust-analyzer when launching in VS Code r=matklad a=jonas-schievink This is usually the right thing, and previously would launch a stale r-a server. Co-authored-by: Jonas Schievink <[email protected]>
2 parents 07f690d + 61c28c2 commit 0d7c997

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"outFiles": [
4242
"${workspaceFolder}/editors/code/out/**/*.js"
4343
],
44-
"preLaunchTask": "Build Extension",
44+
"preLaunchTask": "Build Server and Extension",
4545
"skipFiles": [
4646
"<node_internals>/**/*.js"
4747
],
@@ -62,7 +62,7 @@
6262
"outFiles": [
6363
"${workspaceFolder}/editors/code/out/**/*.js"
6464
],
65-
"preLaunchTask": "Build Extension",
65+
"preLaunchTask": "Build Server (Release) and Extension",
6666
"skipFiles": [
6767
"<node_internals>/**/*.js"
6868
],

.vscode/tasks.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"label": "Build Extension",
7+
"label": "Build Extension in Background",
88
"group": "build",
99
"type": "npm",
1010
"script": "watch",
@@ -15,12 +15,41 @@
1515
},
1616
"isBackground": true,
1717
},
18+
{
19+
"label": "Build Extension",
20+
"group": "build",
21+
"type": "npm",
22+
"script": "build",
23+
"path": "editors/code/",
24+
"problemMatcher": {
25+
"base": "$tsc",
26+
"fileLocation": ["relative", "${workspaceFolder}/editors/code/"]
27+
},
28+
},
1829
{
1930
"label": "Build Server",
2031
"group": "build",
2132
"type": "shell",
2233
"command": "cargo build --package rust-analyzer",
2334
"problemMatcher": "$rustc"
2435
},
36+
{
37+
"label": "Build Server (Release)",
38+
"group": "build",
39+
"type": "shell",
40+
"command": "cargo build --release --package rust-analyzer",
41+
"problemMatcher": "$rustc"
42+
},
43+
44+
{
45+
"label": "Build Server and Extension",
46+
"dependsOn": ["Build Server", "Build Extension"],
47+
"problemMatcher": "$rustc"
48+
},
49+
{
50+
"label": "Build Server (Release) and Extension",
51+
"dependsOn": ["Build Server (Release)", "Build Extension"],
52+
"problemMatcher": "$rustc"
53+
}
2554
]
2655
}

editors/code/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"scripts": {
2828
"vscode:prepublish": "tsc && rollup -c",
2929
"package": "vsce package -o rust-analyzer.vsix",
30+
"build": "tsc",
3031
"watch": "tsc --watch",
3132
"lint": "tsfmt --verify && eslint -c .eslintrc.js --ext ts ./src",
3233
"fix": " tsfmt -r && eslint -c .eslintrc.js --ext ts ./src --fix"

0 commit comments

Comments
 (0)