File tree 3 files changed +46
-1
lines changed
3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ export class BlueprintTaskProvider implements TaskProviderBase {
62
62
panel : vscode . TaskPanelKind . Dedicated ,
63
63
focus : true ,
64
64
}
65
+
66
+ const settings = vscode . workspace . getConfiguration ( "tact" )
67
+ const useProblemMatcher = settings . get < boolean > ( "linters.useProblemMatcher" ) ?? false
68
+ if ( useProblemMatcher ) {
69
+ task . problemMatchers = [ "$tact" ]
70
+ }
71
+
65
72
return task
66
73
}
67
74
}
@@ -118,6 +125,12 @@ export class TactTemplateTaskProvider implements TaskProviderBase {
118
125
focus : true ,
119
126
}
120
127
128
+ const settings = vscode . workspace . getConfiguration ( "tact" )
129
+ const useProblemMatcher = settings . get < boolean > ( "linters.useProblemMatcher" ) ?? false
130
+ if ( useProblemMatcher ) {
131
+ task . problemMatchers = [ "$tact" ]
132
+ }
133
+
121
134
return task
122
135
}
123
136
}
Original file line number Diff line number Diff line change 121
121
"command" : " tact.build" ,
122
122
"title" : " Build Project" ,
123
123
"category" : " Tact" ,
124
- "icon" : " $(gear)"
124
+ "icon" : " $(gear)" ,
125
+ "problemMatcher" : [
126
+ " $tact"
127
+ ]
125
128
},
126
129
{
127
130
"command" : " tact/getTypeAtPosition" ,
436
439
"default" : false ,
437
440
"description" : " Enable Tact compiler analysis"
438
441
},
442
+ "tact.linters.useProblemMatcher" : {
443
+ "type" : " boolean" ,
444
+ "default" : false ,
445
+ "description" : " Highlight errors in editor after build"
446
+ },
439
447
"tact.linters.misti.enable" : {
440
448
"type" : " boolean" ,
441
449
"default" : false ,
486
494
"type" : " tact-template-test" ,
487
495
"properties" : {}
488
496
}
497
+ ],
498
+ "problemMatchers" : [
499
+ {
500
+ "name" : " tact" ,
501
+ "owner" : " tact" ,
502
+ "fileLocation" : [
503
+ " relative" ,
504
+ " ${workspaceFolder}"
505
+ ],
506
+ "pattern" : [
507
+ {
508
+ "regexp" : " ^Error:\\ s+(.+):(\\ d+):(\\ d+):\\ s+(.+)$" ,
509
+ "file" : 1 ,
510
+ "line" : 2 ,
511
+ "column" : 3 ,
512
+ "message" : 4
513
+ }
514
+ ],
515
+ "severity" : " error"
516
+ }
489
517
]
490
518
},
491
519
"dependencies" : {
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export interface TactSettings {
68
68
enable : boolean
69
69
binPath : string
70
70
}
71
+ useProblemMatcher : boolean
71
72
}
72
73
}
73
74
@@ -137,6 +138,7 @@ const defaultSettings: TactSettings = {
137
138
enable : false ,
138
139
binPath : "npx misti" ,
139
140
} ,
141
+ useProblemMatcher : false ,
140
142
} ,
141
143
}
142
144
@@ -241,6 +243,8 @@ function mergeSettings(vsSettings: Partial<TactSettings>): TactSettings {
241
243
enable : vsSettings . linters ?. misti . enable ?? defaultSettings . linters . misti . enable ,
242
244
binPath : vsSettings . linters ?. misti . binPath ?? defaultSettings . linters . misti . binPath ,
243
245
} ,
246
+ useProblemMatcher :
247
+ vsSettings . linters ?. useProblemMatcher ?? defaultSettings . linters . useProblemMatcher ,
244
248
} ,
245
249
}
246
250
}
You can’t perform that action at this time.
0 commit comments