File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ async function watchEditsToRestartLanguageClient(context: ExtensionContext) {
264
264
try {
265
265
// get the absolute URI to this relative path
266
266
let configUri = Uri . file (
267
- workspace . workspaceFolders ! [ 0 ] . uri . fsPath + '/' + configPath
267
+ path . join ( workspace . workspaceFolders ! [ 0 ] . uri . fsPath , configPath )
268
268
)
269
269
// read the config file
270
270
let configText = await workspace . fs . readFile ( configUri )
Original file line number Diff line number Diff line change 1
1
import * as vscode from 'vscode'
2
2
import * as yaml from 'js-yaml'
3
+ import path from 'path'
3
4
4
5
import {
5
6
getDocUri ,
@@ -16,8 +17,11 @@ const diagnosticss = getExpectedDiagnosticss()
16
17
17
18
async function writeNewRule ( ) {
18
19
let vscodeuri = vscode . Uri . file (
19
- vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath +
20
- '/rules/no-math-random.yml'
20
+ path . join (
21
+ vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath ,
22
+ 'rules' ,
23
+ 'no-math-random.yml'
24
+ )
21
25
)
22
26
await vscode . workspace . fs . writeFile (
23
27
vscodeuri ,
@@ -34,14 +38,17 @@ note: no Math.random()`)
34
38
}
35
39
async function deleteNewRule ( ) {
36
40
let vscodeuri = vscode . Uri . file (
37
- vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath +
38
- '/rules/no-math-random.yml'
41
+ path . join (
42
+ vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath ,
43
+ 'rules' ,
44
+ 'no-math-random.yml'
45
+ )
39
46
)
40
47
await vscode . workspace . fs . delete ( vscodeuri )
41
48
}
42
49
async function setRuleDirs ( newRuleDirs : string [ ] ) {
43
50
let vscodeuri = vscode . Uri . file (
44
- vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath + '/ sgconfig.yml'
51
+ path . join ( vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath , ' sgconfig.yml')
45
52
)
46
53
let content = await vscode . workspace . fs . readFile ( vscodeuri )
47
54
let configText = new TextDecoder ( ) . decode ( content )
You can’t perform that action at this time.
0 commit comments