@@ -77,15 +77,14 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
7777 // testing given configuration:
7878 var re = / t o t a l : \d * e r r o r s , \d * w a r n i n g s , ( \d * c h e c k s , ) ? \d * l i n e s c h e c k e d / g;
7979 let args = this . linterConfig . args . slice ( ) ;
80- let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . name : undefined ;
80+ let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath : undefined ;
8181 args . push ( '--no-tree - ' ) ;
8282 let childProcess = cp . spawnSync ( this . linterConfig . path , args , { shell : true , input : ' ' , cwd : cwd } ) ;
83- if ( childProcess . pid && re . test ( childProcess . stdout . toString ( ) ) ) {
83+ if ( childProcess . pid && childProcess . stdout && re . test ( childProcess . stdout . toString ( ) ) ) {
8484 // all good
8585 } else {
8686 vscode . window . showErrorMessage (
8787 `Checkpatch: calling '${ this . linterConfig . path } ' failed, please check checkpatch.checkpatchPath and checkpatch.checkpatchPath configutations.` ) ;
88- console . log ( `Checkpatch: '${ this . linterConfig . path } ' '${ args } '` )
8988 if ( childProcess . stderr )
9089 console . log ( `Checkpatch: '${ childProcess . stderr . toString ( ) } '` )
9190 return ;
@@ -103,9 +102,9 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
103102
104103 private parseCheckpatchLog ( log : string , basePath : string ) : number {
105104 const dictionary : { [ fileUri : string ] : vscode . Diagnostic [ ] } = { } ;
106-
107105 var re = / ( W A R N I N G | E R R O R | C H E C K ) : ? ( .+ ) : ( .+ ) ? (?: \n | \r \n | ) # \d + : F I L E : ( .* ) : ( \d + ) : / g;
108106 var matches ;
107+
109108 while ( matches = re . exec ( log ) ) {
110109 let type = matches [ 2 ] ;
111110 let message = matches [ 3 ] ;
@@ -143,7 +142,7 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
143142
144143 let log = '' ;
145144 let args = this . linterConfig . args . slice ( ) ;
146- let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . name : undefined ;
145+ let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath : undefined ;
147146 args . push ( '--show-types -f' ) ;
148147 args . push ( textDocument . fileName . replace ( / \\ / g, '/' ) ) ;
149148
0 commit comments