Skip to content

Commit ca07b5e

Browse files
authored
execute formatter from cwd (#466)
Co-authored-by: Andrew Nolte <[email protected]>
1 parent a590f49 commit ca07b5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/FormatPrivider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ abstract class FileBasedFormattingEditProvider implements vscode.DocumentFormatt
6868
let binPath: string = this.config.get('path');
6969
this.logger.info('Executing command: ' + binPath + ' ' + args.join(' '));
7070
try {
71-
child_process.execFileSync(binPath, args, {});
71+
child_process.execFileSync(binPath, args, {cwd: vscode.workspace.workspaceFolders[0].uri.fsPath});
7272
let formattedText: string = tempFile.readFileSync({ encoding: 'utf-8' });
7373
let wholeFileRange: vscode.Range = new vscode.Range(
7474
document.positionAt(0),

0 commit comments

Comments
 (0)