Skip to content

Commit 8ee40cc

Browse files
committed
vscode client side tests
1 parent 4d3fd62 commit 8ee40cc

File tree

11 files changed

+1011
-32
lines changed

11 files changed

+1011
-32
lines changed

.vscode/launch.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,28 @@
7070
"__RA_LSP_SERVER_DEBUG": "${workspaceFolder}/target/release/rust-analyzer"
7171
}
7272
},
73+
{
74+
// Used for testing the extension with a local build of the LSP server (in `target/release`)
75+
// with all other extendions loaded.
76+
"name": "Run With Extensions",
77+
"type": "extensionHost",
78+
"request": "launch",
79+
"runtimeExecutable": "${execPath}",
80+
"args": [
81+
"--disable-extension", "matklad.rust-analyzer",
82+
"--extensionDevelopmentPath=${workspaceFolder}/editors/code"
83+
],
84+
"outFiles": [
85+
"${workspaceFolder}/editors/code/out/**/*.js"
86+
],
87+
"preLaunchTask": "Build Server (Release) and Extension",
88+
"skipFiles": [
89+
"<node_internals>/**/*.js"
90+
],
91+
"env": {
92+
"__RA_LSP_SERVER_DEBUG": "${workspaceFolder}/target/release/rust-analyzer"
93+
}
94+
},
7395
{
7496
// Used to attach LLDB to a running LSP server.
7597
// NOTE: Might require root permissions. For this run:
@@ -87,5 +109,17 @@
87109
"rust"
88110
]
89111
},
112+
{
113+
"name": "Run Unit Tests",
114+
"type": "extensionHost",
115+
"request": "launch",
116+
"runtimeExecutable": "${execPath}",
117+
"args": [
118+
"--extensionDevelopmentPath=${workspaceFolder}/editors/code",
119+
"--extensionTestsPath=${workspaceFolder}/editors/code/out/tests/unit" ],
120+
"sourceMaps": true,
121+
"outFiles": [ "${workspaceFolder}/editors/code/out/tests/unit/**/*.js" ],
122+
"preLaunchTask": "Pretest"
123+
}
90124
]
91125
}

.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
"command": "cargo build --release --package rust-analyzer",
4141
"problemMatcher": "$rustc"
4242
},
43+
{
44+
"label": "Pretest",
45+
"group": "build",
46+
"isBackground": false,
47+
"type": "npm",
48+
"script": "pretest",
49+
"path": "editors/code/",
50+
"problemMatcher": {
51+
"base": "$tsc",
52+
"fileLocation": ["relative", "${workspaceFolder}/editors/code/"]
53+
}
54+
},
4355

4456
{
4557
"label": "Build Server and Extension",

editors/code/.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**
2-
!out/main.js
2+
!out/src/main.js
33
!package.json
44
!package-lock.json
55
!ra_syntax_tree.tmGrammar.json

0 commit comments

Comments
 (0)