File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 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) {
264264 try {
265265 // get the absolute URI to this relative path
266266 let configUri = Uri . file (
267- workspace . workspaceFolders ! [ 0 ] . uri . fsPath + '/' + configPath
267+ path . join ( workspace . workspaceFolders ! [ 0 ] . uri . fsPath , configPath )
268268 )
269269 // read the config file
270270 let configText = await workspace . fs . readFile ( configUri )
Original file line number Diff line number Diff line change 11import * as vscode from 'vscode'
22import * as yaml from 'js-yaml'
3+ import path from 'path'
34
45import {
56 getDocUri ,
@@ -16,8 +17,11 @@ const diagnosticss = getExpectedDiagnosticss()
1617
1718async function writeNewRule ( ) {
1819 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+ )
2125 )
2226 await vscode . workspace . fs . writeFile (
2327 vscodeuri ,
@@ -34,14 +38,17 @@ note: no Math.random()`)
3438}
3539async function deleteNewRule ( ) {
3640 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+ )
3946 )
4047 await vscode . workspace . fs . delete ( vscodeuri )
4148}
4249async function setRuleDirs ( newRuleDirs : string [ ] ) {
4350 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')
4552 )
4653 let content = await vscode . workspace . fs . readFile ( vscodeuri )
4754 let configText = new TextDecoder ( ) . decode ( content )
You can’t perform that action at this time.
0 commit comments