@@ -103,42 +103,32 @@ export class APILinter {
103103 { cwd : this . #workspacePath, encoding : "utf-8" }
104104 ) ;
105105 if ( result . status !== 0 ) {
106+ result . stderr = result . stderr . slice ( result . stderr . indexOf ( " " ) ) ;
107+ result . stderr = result . stderr . slice ( result . stderr . indexOf ( " " ) ) ;
108+ result . stderr = result . stderr . slice ( result . stderr . indexOf ( " " ) + 1 ) ;
106109 return result . stderr
107- . split ( " " , 3 ) [ 2 ]
108110 . split ( "\n" )
109111 . map ( ( line ) => {
110- const [ badFile , lineNo , columnNo , description ] = line . split ( ":" , 4 ) ;
112+ if ( ! line ) {
113+ return ;
114+ }
115+ const [ badFile , lineNo , columnNo , ...descriptionParts ] =
116+ line . split ( ":" ) ;
117+ const description = descriptionParts . join ( ":" ) ;
111118 if ( file === badFile ) {
112119 return new vscode . Diagnostic (
113- toRange ( {
114- start_position : {
115- line_number : + lineNo ,
116- column_number : + columnNo ,
117- } ,
118- end_position : {
119- line_number : + lineNo ,
120- column_number : + columnNo ,
121- } ,
122- } ) ,
120+ new vscode . Range ( + lineNo , + columnNo , + lineNo , + columnNo ) ,
123121 description ,
124122 vscode . DiagnosticSeverity . Error
125123 ) ;
126124 }
127125 return new vscode . Diagnostic (
128- toRange ( {
129- start_position : {
130- line_number : 0 ,
131- column_number : 0 ,
132- } ,
133- end_position : {
134- line_number : 0 ,
135- column_number : 0 ,
136- } ,
137- } ) ,
126+ new vscode . Range ( 0 , 0 , 0 , 0 ) ,
138127 description ,
139128 vscode . DiagnosticSeverity . Error
140129 ) ;
141- } ) ;
130+ } )
131+ . filter ( ( value ) : value is vscode . Diagnostic => value !== undefined ) ;
142132 }
143133
144134 const output : Output [ ] = JSON . parse ( result . stdout ) ;
0 commit comments