Skip to content

Commit

Permalink
execute formatter from cwd (mshr-h#466)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Nolte <[email protected]>
  • Loading branch information
AndrewNolte and AndrewNolte authored Feb 21, 2024
1 parent a590f49 commit ca07b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/FormatPrivider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class FileBasedFormattingEditProvider implements vscode.DocumentFormatt
let binPath: string = this.config.get('path');
this.logger.info('Executing command: ' + binPath + ' ' + args.join(' '));
try {
child_process.execFileSync(binPath, args, {});
child_process.execFileSync(binPath, args, {cwd: vscode.workspace.workspaceFolders[0].uri.fsPath});
let formattedText: string = tempFile.readFileSync({ encoding: 'utf-8' });
let wholeFileRange: vscode.Range = new vscode.Range(
document.positionAt(0),
Expand Down

0 comments on commit ca07b5e

Please sign in to comment.