Skip to content

Commit 8bc4d31

Browse files
authored
Merge pull request #503 from fortran-lang/gnikit/issue500
Gnikit/issue500
2 parents fd7839d + 6fb3c95 commit 8bc4d31

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3535

3636
### Changed
3737

38+
- Changed `linter.compilerPath` to use the full path to the compiler instead of the root
39+
([#500](https://github.com/fortran-lang/vscode-fortran-support/issues/500))
3840
- Changed all instances of the publisher to `fortran-lang`
3941
([#450](https://github.com/fortran-lang/vscode-fortran-support/issues/450))
4042
- Updated grammar unittests to include scope injections

src/features/linter-provider.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as path from 'path';
44
import * as cp from 'child_process';
5+
import which from 'which';
56

67
import * as vscode from 'vscode';
78
import { LoggingService } from '../services/logging-service';
@@ -221,19 +222,17 @@ export class FortranLintingProvider {
221222
}
222223

223224
/**
224-
* Returns the linter executable
225+
* Returns the linter executable i.e. this.compilerPath
225226
* @returns String with linter
226227
*/
227228
private getLinterExecutable(): string {
228229
const config = vscode.workspace.getConfiguration('fortran.linter');
229230

230231
this.compiler = config.get<string>('compiler', 'gfortran');
231232
this.compilerPath = config.get<string>('compilerPath', '');
232-
const linter = path.join(this.compilerPath, this.compiler);
233-
234-
this.logger.logInfo(`using linter: ${this.compiler} located in: ${linter}`);
235-
236-
return linter;
233+
if (this.compilerPath === '') this.compilerPath = which.sync(this.compiler);
234+
this.logger.logInfo(`using linter: ${this.compiler} located in: ${this.compilerPath}`);
235+
return this.compilerPath;
237236
}
238237

239238
/**

test/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as path from 'path';
2-
import * as Mocha from 'mocha';
3-
import * as glob from 'glob';
1+
import path from 'path';
2+
import Mocha from 'mocha';
3+
import glob from 'glob';
44

55
export function run(): Promise<void> {
66
// Create the mocha test

tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"lib": ["ES2020"],
77
"sourceMap": true,
88
"rootDir": ".",
9-
"resolveJsonModule": true
9+
"resolveJsonModule": true,
10+
"esModuleInterop": true,
11+
"removeComments": true
1012
},
1113
"include": ["test/**/*.ts", "syntaxes/*.json"],
1214
"exclude": ["node_modules", ".vscode-test"]

0 commit comments

Comments
 (0)