Skip to content

Commit 548ffd7

Browse files
committed
Installing findent through pip
1 parent 8b72230 commit 548ffd7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/features/formatting-provider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ export class FortranFormattingProvider
7777

7878
const formatterName: string = 'findent';
7979
let formatterPath: string = this.getFormatterPath();
80+
// If no formatter path is present check that formatter is present in $PATH
81+
if (!formatterPath) {
82+
if (!which.sync(formatterName, { nothrow: true })) {
83+
this.logger.logWarning(`Formatter: ${formatterName} not detected in your system.
84+
Attempting to install now.`);
85+
let msg = `Installing ${formatterName} through pip with --user option`;
86+
promptForMissingTool(formatterName, msg, 'Python');
87+
}
88+
}
8089
let formatter: string = path.join(formatterPath, formatterName);
8190

8291
// Annoyingly findent only outputs to a file and not to a stream so

0 commit comments

Comments
 (0)