Skip to content

Commit e4d3297

Browse files
committed
feat: path variable resolution for fortls
Fixes #664
1 parent 81a0542 commit e4d3297

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

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

1010
### Added
1111

12+
- Added support for variable resolution in `fortls`
13+
([#664](https://github.com/fortran-lang/vscode-fortran-support/issues/664))
1214
- Added Run and Debug buttons for single Fortran files based on linter settings
1315
([#646](https://github.com/fortran-lang/vscode-fortran-support/issues/646))
1416
- Added linter support for [LFortran](https://lfortran.org/)

src/lsp/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
isFortran,
1313
getOuterMostWorkspaceFolder,
1414
pipInstall,
15+
resolveVariables,
1516
} from '../lib/tools';
1617
import { Logger } from '../services/logging';
1718
import { RestartLS } from '../features/commands';
@@ -82,7 +83,8 @@ export class FortlsClient {
8283
if (!isFortran(document)) return;
8384

8485
const args: string[] = await this.fortlsArguments();
85-
const executablePath = workspace.getConfiguration(EXTENSION_ID).get<string>('fortls.path');
86+
const fortlsPath = workspace.getConfiguration(EXTENSION_ID).get<string>('fortls.path');
87+
const executablePath = resolveVariables(fortlsPath);
8688

8789
// Detect language server version and verify selected options
8890
this.version = this.getLSVersion(executablePath, args);
@@ -304,7 +306,7 @@ export class FortlsClient {
304306
*/
305307
private async fortlsDownload(): Promise<boolean> {
306308
const config = workspace.getConfiguration(EXTENSION_ID);
307-
const ls = config.get<string>('fortls.path');
309+
const ls = resolveVariables(config.get<string>('fortls.path'));
308310

309311
// Check for version, if this fails fortls provided is invalid
310312
const results = spawnSync(ls, ['--version']);

0 commit comments

Comments
 (0)