Skip to content

Commit 19f81f6

Browse files
authored
fix linter not working (#56)
1 parent d0f2b04 commit 19f81f6

File tree

6 files changed

+2862
-10
lines changed

6 files changed

+2862
-10
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"url": "https://github.com/krvajalmiguelangel/vscode-fortran-support.git"
1515
},
1616
"categories": ["Languages", "Snippets", "Linters"],
17-
"activationEvents": ["onLanguage:fortran_free-form"],
17+
"activationEvents": ["onLanguage:FortranFreeForm"],
1818
"main": "./out/src/extension",
1919
"contributes": {
2020
"languages": [
2121
{
22-
"id": "fortran_free-form",
22+
"id": "FortranFreeForm",
2323
"aliases": ["Fortran90", "fortran90"],
2424
"extensions": [".f90", ".F90", ".f95", ".F95", ".f08", ".F08"],
2525
"configuration": "./language-configuration.json"
@@ -32,7 +32,7 @@
3232
],
3333
"grammars": [
3434
{
35-
"language": "fortran_free-form",
35+
"language": "FortranFreeForm",
3636
"scopeName": "source.fortran.free",
3737
"path": "./syntaxes/fortran_free-form.tmLanguage.json"
3838
},
@@ -44,7 +44,7 @@
4444
],
4545
"snippets": [
4646
{
47-
"language": "fortran_free-form",
47+
"language": "FortranFreeForm",
4848
"path": "./snippets/fortran90.json"
4949
}
5050
],

src/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import FortranLintingProvider from "./features/linter-provider";
55
import FortranHoverProvider from "./features/hover-provider";
66
import { FortranCompletionProvider } from "./features/completion-provider";
77
import { FortranDocumentSymbolProvider } from "./features/document-symbol-provider";
8+
import { LANGUAGE_ID } from './lib/helper';
89

9-
const FORTRAN_FREE_FORM_ID = { language: "fortran_free-form", scheme: "file" };
10+
const FORTRAN_FREE_FORM_ID = { language: LANGUAGE_ID, scheme: "file" };
1011

1112
export function activate(context: vscode.ExtensionContext) {
1213
let hoverProvider = new FortranHoverProvider();

src/features/document-symbol-provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class FortranDocumentSymbolProvider
5757
}
5858
}
5959
return symbols;
60-
}
60+
};
61+
6162
getSymbolsOfType(type: "subroutine" | "function" | "variable"): ParserFunc {
6263
switch (type) {
6364
case "subroutine":
@@ -100,6 +101,7 @@ export class FortranDocumentSymbolProvider
100101
);
101102
}
102103
}
104+
103105
private parseVariableDefinition(line: TextLine) {
104106
const variable = getDeclaredVar(line);
105107
if (variable) {
@@ -111,6 +113,7 @@ export class FortranDocumentSymbolProvider
111113
);
112114
}
113115
}
116+
114117
getSymbolTypes() {
115118
let config = vscode.workspace.getConfiguration("fortran");
116119
const symbolTypes = config.get<SymbolType[]>("symbols", [

src/features/linter-provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class FortranLintingProvider {
1818
if (textDocument.languageId !== LANGUAGE_ID || textDocument.uri.scheme !== "file") {
1919
return;
2020
}
21+
2122
let decoded = "";
2223
let diagnostics: vscode.Diagnostic[] = [];
2324
let command = this.getGfortranPath();

src/lib/helper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import * as fs from 'fs';
33
import * as vscode from 'vscode';
44

5-
6-
7-
export const LANGUAGE_ID = 'fortran90';
8-
5+
// IMPORTANT: this should match the value
6+
// on the package.json otherwise the extension won't
7+
// work at all ⛽️
8+
export const LANGUAGE_ID = 'FortranFreeForm';
99

1010
export const intrinsics = [
1111
"ABORT", "ABS", "ACCESS", "ACHAR", "ACOS", "ACOSH", "ADJUSTL", "ADJUSTR", "AIMAG", "AINT", "ALARM", "ALL", "ALLOCATED", "AND", "ANINT", "ANY", "ASIN", "ASINH", "ASSOCIATED", "ATAN", "ATAN2",

0 commit comments

Comments
 (0)