File tree 6 files changed +25
-6
lines changed
6 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 49
49
50
50
- name : Build Language Server
51
51
working-directory : editors/vscode
52
- run : pnpm run server:build:release
52
+ run : pnpm run server:build:debug
53
53
54
54
- name : Compile VSCode
55
55
working-directory : editors/vscode
Original file line number Diff line number Diff line change 11
11
"sourceMaps" : true ,
12
12
"outFiles" : [" ${workspaceFolder}/editors/vscode/dist/*.js" ],
13
13
"env" : {
14
- "SERVER_PATH_DEV" : " ${workspaceRoot}/target/debug/oxc_language_server" ,
14
+ "SERVER_PATH_DEV" : " ${workspaceRoot}/editors/vscode/ target/debug/oxc_language_server" ,
15
15
"RUST_LOG" : " debug"
16
16
}
17
17
},
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from '@vscode/test-cli' ;
2
2
import { existsSync , mkdirSync } from 'node:fs' ;
3
+ import path from 'node:path' ;
3
4
4
5
if ( ! existsSync ( './test_workspace' ) ) {
5
6
mkdirSync ( './test_workspace' ) ;
6
7
}
7
8
9
+ const ext = process . platform === 'win32' ? '.exe' : '' ;
10
+
8
11
export default defineConfig ( {
9
- files : 'out/**/*.spec.js' ,
10
- workspaceFolder : './test_workspace' ,
12
+ tests : [ {
13
+ files : 'out/**/*.spec.js' ,
14
+ workspaceFolder : './test_workspace' ,
15
+ launchArgs : [
16
+ // This disables all extensions except the one being testing
17
+ '--disable-extensions' ,
18
+ ] ,
19
+ env : {
20
+ SERVER_PATH_DEV : path . resolve ( import . meta. dirname , `./target/debug/oxc_language_server${ ext } ` ) ,
21
+ } ,
22
+ } ] ,
11
23
} ) ;
Original file line number Diff line number Diff line change @@ -19,3 +19,8 @@ This is the linter for Oxc. The currently supported features are listed below.
19
19
- Command to fix all auto-fixable content within the current text editor.
20
20
- Support for ` source.fixAll.oxc ` as a code action provider. Configure this in your settings ` editor.codeActionsOnSave `
21
21
to automatically apply fixes when saving the file.
22
+
23
+ ## Testing
24
+
25
+ Run ` pnpm server:build:debug ` to build the language server.
26
+ After that, you can test the vscode plugin + E2E Tests with ` pnm test `
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ suite('commands', () => {
16
16
17
17
suiteTeardown ( async ( ) => {
18
18
const edit = new WorkspaceEdit ( ) ;
19
- edit . deleteFile ( fileUri ) ;
19
+ edit . deleteFile ( fileUri , {
20
+ ignoreIfNotExists : true ,
21
+ } ) ;
20
22
await workspace . applyEdit ( edit ) ;
21
23
} ) ;
22
24
Original file line number Diff line number Diff line change 143
143
"watch" : " pnpm run compile --watch" ,
144
144
"package" : " vsce package --no-dependencies -o oxc_language_server.vsix" ,
145
145
"install-extension" : " code --install-extension oxc_language_server.vsix --force" ,
146
- "server:build:debug" : " cargo build -p oxc_language_server" ,
146
+ "server:build:debug" : " cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server" ,
147
147
"server:build:release" : " cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server --release" ,
148
148
"lint" : " npx oxlint --config=oxlint.json --tsconfig=tsconfig.json" ,
149
149
"test" : " esbuild client/*.spec.ts --bundle --outdir=out --external:vscode --format=cjs --platform=node --target=node16 --minify --sourcemap && vscode-test" ,
You can’t perform that action at this time.
0 commit comments