File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 411
411
"update-vscode" : " node ./node_modules/vscode/bin/install" ,
412
412
"test" : " node ./out/test/runTest.js" ,
413
413
"lint" : " eslint . --ext .js,.ts" ,
414
- "check-formatting" : " prettier --check ./src/**/*.ts .*.js "
414
+ "check-formatting" : " prettier --check ./src/**/*.ts .*.js " ,
415
+ "fix-formatting" : " prettier --write ./src/**/*.ts .*.js "
415
416
},
416
417
"devDependencies" : {
417
418
"@types/glob" : " ^7.1.3" ,
Original file line number Diff line number Diff line change @@ -19,14 +19,29 @@ export default function runFromCodeLens(args: RunArgs): void {
19
19
elixirLsTerminal . sendText ( buildTestCommand ( args ) ) ;
20
20
}
21
21
22
+ function escapeSingleQuotes ( s : string ) : string {
23
+ return isWindows ( ) ? s : s . replace ( / ' / g, "'\\''" ) ;
24
+ }
25
+
26
+ function quote ( s : string ) : string {
27
+ const q = isWindows ( ) ? '"' : `'` ;
28
+ return [ q , s , q ] . join ( "" ) ;
29
+ }
30
+
31
+ function isWindows ( ) : boolean {
32
+ return process . platform . includes ( "win32" ) ;
33
+ }
34
+
22
35
function buildTestCommand ( args : RunArgs ) : string {
23
36
const testFilter = buildTestInclude (
24
37
args . describe ,
25
38
args . testName ,
26
39
args . module
27
40
) ;
28
41
29
- return `mix test --exclude test --include "${ testFilter } " ${ args . filePath } ` ;
42
+ return `mix test --exclude test --include ${ quote (
43
+ escapeSingleQuotes ( testFilter )
44
+ ) } ${ args . filePath } `;
30
45
}
31
46
32
47
function buildTestInclude (
You can’t perform that action at this time.
0 commit comments