File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,21 @@ export class SaxonTaskProvider implements vscode.TaskProvider {
67
67
let rootPath = vscode . workspace . rootPath ? vscode . workspace . rootPath : '/' ;
68
68
let tasksPath = path . join ( rootPath , '.vscode' , 'tasks.json' ) ;
69
69
let tasksObject = undefined ;
70
+
70
71
if ( await exists ( tasksPath ) ) {
71
- delete require . cache [ tasksPath ] ;
72
- tasksObject = require ( tasksPath ) ;
72
+ const tasksText = fs . readFileSync ( tasksPath ) . toString ( 'utf-8' ) ;
73
+ const taskLines = tasksText . split ( "\n" ) ;
74
+ const jsonTaskLines : string [ ] = [ ] ;
75
+ taskLines . forEach ( ( taskLine ) => {
76
+ if ( taskLine . trimLeft ( ) . startsWith ( '//' ) ) {
77
+ // don't add comment
78
+ } else {
79
+ jsonTaskLines . push ( taskLine ) ;
80
+ }
81
+ } ) ;
82
+ const jsonString = jsonTaskLines . join ( '\n' ) ;
83
+ tasksObject = JSON . parse ( jsonString ) ;
84
+
73
85
} else {
74
86
tasksObject = { tasks : [ ] } ;
75
87
}
You can’t perform that action at this time.
0 commit comments