@@ -68,8 +68,9 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
6868 // testing given configuration:
6969 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;
7070 let args = this . linterConfig . args . slice ( ) ;
71- args . push ( '--no-tree - ' ) ;
72- let childProcess = cp . spawnSync ( this . linterConfig . path , args , { shell : true , input : ' ' } ) ;
71+ let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . name : undefined ;
72+ args . push ( '--no-tree - ' ) ;
73+ let childProcess = cp . spawnSync ( this . linterConfig . path , args , { shell : true , input : ' ' , cwd : cwd } ) ;
7374 if ( childProcess . pid && re . test ( childProcess . stdout . toString ( ) ) ) {
7475 // all good
7576 } else {
@@ -135,10 +136,11 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
135136
136137 let log = '' ;
137138 let args = this . linterConfig . args . slice ( ) ;
139+ let cwd = vscode . workspace . workspaceFolders ? vscode . workspace . workspaceFolders [ 0 ] . name : undefined ;
138140 args . push ( '--show-types -f' ) ;
139141 args . push ( textDocument . fileName . replace ( / \\ / g, '/' ) ) ;
140142
141- let childProcess = cp . spawn ( this . linterConfig . path , args , { shell : true } ) ;
143+ let childProcess = cp . spawn ( this . linterConfig . path , args , { shell : true , cwd : cwd } ) ;
142144 if ( childProcess . pid ) {
143145 // clean old diagostics. Prevents files with only one warning from being updated
144146 this . diagnosticCollection . delete ( textDocument . uri ) ;
0 commit comments