From f4417f9150988a3dc2678de1396060552460542f Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Sat, 22 Jun 2019 22:30:03 +0100 Subject: [PATCH 01/21] map Fortran subroutine to vscode Function kind --- src/features/document-symbol-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/document-symbol-provider.ts b/src/features/document-symbol-provider.ts index c8e2ffa3..8c0128e0 100644 --- a/src/features/document-symbol-provider.ts +++ b/src/features/document-symbol-provider.ts @@ -80,7 +80,7 @@ export class FortranDocumentSymbolProvider let range = new vscode.Range(line.range.start, line.range.end); return new vscode.SymbolInformation( fun.name, - vscode.SymbolKind.Method, + vscode.SymbolKind.Function, range ); } From b3a13de14f0b5c46e597424f9082452750f7f221 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 13:31:35 +0000 Subject: [PATCH 02/21] Bump lodash from 4.17.11 to 4.17.14 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14) Signed-off-by: dependabot[bot] --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18339f9a..fab26b6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linter-gfortran", - "version": "2.0.2", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -83,6 +83,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -2065,7 +2066,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -3489,9 +3490,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", "dev": true }, "lodash._basecopy": { @@ -3680,7 +3681,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loud-rejection": { "version": "1.6.0", From fbcb0ddf49c40b7ad7d0bc05134488345af2c467 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2019 19:48:10 +0000 Subject: [PATCH 03/21] Bump mixin-deep from 1.3.1 to 1.3.2 Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18339f9a..86fc135b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linter-gfortran", - "version": "2.0.2", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -83,6 +83,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -2065,7 +2066,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -3680,7 +3681,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loud-rejection": { "version": "1.6.0", @@ -3846,9 +3848,9 @@ "dev": true }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", From 6d26c9c6e4b5adf4d5e298a705d41bcb913a676a Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Wed, 4 Dec 2019 15:22:27 -0500 Subject: [PATCH 04/21] Fix blocking due to very slow regex execution in "parseFunction" --- src/lib/functions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/functions.ts b/src/lib/functions.ts index b289a944..579e74c8 100644 --- a/src/lib/functions.ts +++ b/src/lib/functions.ts @@ -74,7 +74,7 @@ export const parseSubroutine = (line: TextLine) => { return _parse(line, MethodType.Subroutine); }; export const _parse = (line: TextLine, type: MethodType) => { - const functionRegEx = /([a-zA-Z]+(\([\w.=]+\))*)*\s*\bfunction\b\s*([a-zA-Z_][a-z0-9_]*)\s*\((\s*[a-z_][a-z0-9_,\s]*)*\s*(\)|\&)\s*(result\([a-z_][\w]*(\)|\&))*/i; + const functionRegEx = /(?<=([a-zA-Z]+(\([\w.=]+\))*)*)\s*\bfunction\b\s*([a-zA-Z_][a-z0-9_]*)\s*\((\s*[a-z_][a-z0-9_,\s]*)*\s*(?:\)|\&)\s*(result\([a-z_][\w]*(?:\)|\&))*/i; const subroutineRegEx = /^\s*(?!\bend\b)\w*\s*\bsubroutine\b\s*([a-z][a-z0-9_]*)\s*(?:\((\s*[a-z][a-z0-9_,\s]*)*\s*(\)|\&))*/i; const regEx = type === MethodType.Subroutine ? subroutineRegEx : functionRegEx; From e130700118549ad8268287281a188ddce3215289 Mon Sep 17 00:00:00 2001 From: Chris Hansen Date: Wed, 4 Dec 2019 15:24:36 -0500 Subject: [PATCH 05/21] Add support for disabling Hover, Completion and Symbol providers --- package.json | 15 +++++++++++++++ src/extension.ts | 38 ++++++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 19bea2df..204e93f6 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,11 @@ ], "description": "Specify additional options to use when calling the gfortran compiler" }, + "fortran.provideSymbols": { + "type": "boolean", + "default": true, + "description": "Enables or disables symbol functionality (disable if using 'Fortran IntelliSense')" + }, "fortran.symbols": { "type": [ "array" @@ -133,6 +138,16 @@ ], "description": "Specify what kind of symbols should be shown by the symbols' provider" }, + "fortran.provideHover": { + "type": "boolean", + "default": true, + "description": "Enables or hover functionality (disable if using 'Fortran IntelliSense')" + }, + "fortran.provideCompletion": { + "type": "boolean", + "default": true, + "description": "Enables or disables completion functionality (disable if using 'Fortran IntelliSense')" + }, "fortran.preferredCase": { "type": "string", "default": "lowercase", diff --git a/src/extension.ts b/src/extension.ts index ae17fd11..29ab86ad 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,9 +11,6 @@ import { FortranLangServer, checkForLangServer } from './lang-server' export function activate(context: vscode.ExtensionContext) { - let hoverProvider = new FortranHoverProvider() - let completionProvider = new FortranCompletionProvider() - let symbolProvider = new FortranDocumentSymbolProvider() const extensionConfig = vscode.workspace.getConfiguration(EXTENSION_ID) @@ -23,17 +20,30 @@ export function activate(context: vscode.ExtensionContext) { vscode.languages.registerCodeActionsProvider(FORTRAN_FREE_FORM_ID, linter) } - vscode.languages.registerCompletionItemProvider( - FORTRAN_FREE_FORM_ID, - completionProvider - ) - vscode.languages.registerHoverProvider(FORTRAN_FREE_FORM_ID, hoverProvider) - - vscode.languages.registerDocumentSymbolProvider( - FORTRAN_FREE_FORM_ID, - symbolProvider - ) - + if (extensionConfig.get('provideCompletion', true)) { + let completionProvider = new FortranCompletionProvider() + vscode.languages.registerCompletionItemProvider( + FORTRAN_FREE_FORM_ID, + completionProvider + ) + } + + if (extensionConfig.get('provideHover', true)) { + let hoverProvider = new FortranHoverProvider() + vscode.languages.registerHoverProvider( + FORTRAN_FREE_FORM_ID, + hoverProvider + ) + } + + if (extensionConfig.get('provideSymbols', true)) { + let symbolProvider = new FortranDocumentSymbolProvider() + vscode.languages.registerDocumentSymbolProvider( + FORTRAN_FREE_FORM_ID, + symbolProvider + ) + } + if (checkForLangServer(extensionConfig)) { const langServer = new FortranLangServer(context, extensionConfig) From 3480f6592daa83a3c80ba9cf7186a04343f52991 Mon Sep 17 00:00:00 2001 From: Andrew Best Date: Fri, 24 Jan 2020 11:09:53 -0800 Subject: [PATCH 06/21] Added select rank --- syntaxes/fortran_free-form.tmLanguage.json | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 4f6cb6b1..d84b7b97 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -1334,6 +1334,49 @@ } ] }, + { + "comment": "Select rank construct. Introduced in the Fortran 2018 standard.", + "begin": "(?i)\\s*(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "patterns": [ + { + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=[;!\\n])", + "patterns": [ + { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { + "1": { + "name": "keyword.control.default.fortran" + } + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" + } + ] + }, + { + "include": "$base" + } + ] + }, { "comment": "Select type construct. Introduced in the Fortran 2003 standard.", "begin": "(?i)\\s*(type)\\b", From 4e89a1cb93982a9d9bf2bf2ae3cdbe086d69d14a Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Mon, 24 Feb 2020 13:34:53 -0300 Subject: [PATCH 07/21] Fix symbols in VSCode ^1.40 --- src/features/document-symbol-provider.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/features/document-symbol-provider.ts b/src/features/document-symbol-provider.ts index c8e2ffa3..d3e5b54f 100644 --- a/src/features/document-symbol-provider.ts +++ b/src/features/document-symbol-provider.ts @@ -44,7 +44,6 @@ export class FortranDocumentSymbolProvider for (let i = 0; i < lines; i++) { let line: vscode.TextLine = document.lineAt(i); - line = { ...line, text: line.text.trim() }; if (line.isEmptyOrWhitespace) continue; let initialCharacter = line.text.trim().charAt(0); if (initialCharacter === "!" || initialCharacter === "#") continue; @@ -75,11 +74,11 @@ export class FortranDocumentSymbolProvider private parseSubroutineDefinition(line: TextLine) { try { - const fun = getDeclaredSubroutine(line); - if (fun) { + const subroutine = getDeclaredSubroutine(line); + if (subroutine) { let range = new vscode.Range(line.range.start, line.range.end); return new vscode.SymbolInformation( - fun.name, + subroutine.name, vscode.SymbolKind.Method, range ); @@ -90,12 +89,11 @@ export class FortranDocumentSymbolProvider } private parseFunctionDefinition(line: TextLine) { - const subroutine = getDeclaredFunction(line); - if (subroutine) { + const fun = getDeclaredFunction(line); + if (fun) { let range = new vscode.Range(line.range.start, line.range.end); - return new vscode.SymbolInformation( - subroutine.name, + fun.name, vscode.SymbolKind.Function, range ); From 2f2f8e8686c982c15102581cc823a89a4b1de7fb Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Mon, 24 Feb 2020 15:29:02 -0300 Subject: [PATCH 08/21] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 19bea2df..7468c93b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "linter-gfortran", "displayName": "Modern Fortran", "description": "Modern Fortran language support, including syntax highlighting and error detection.", - "version": "2.1.1", + "version": "2.1.2", "publisher": "krvajalm", "engines": { "vscode": "^1.30.x" From 80edd63d777dde60aaea4b6c325fe68bf1ffa046 Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Mon, 24 Feb 2020 16:04:42 -0300 Subject: [PATCH 09/21] Fix autoclosing pair for array constructor --- language-configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language-configuration.json b/language-configuration.json index 4027e926..ff54a94e 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -27,7 +27,7 @@ }, { "open": "(/", - "close": "/)" + "close": "/" } ], "surroundingPairs": [ From 9ce44f63bc5f4b17f4c0c40c479b8d70dc860fc4 Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Mon, 24 Feb 2020 16:39:34 -0300 Subject: [PATCH 10/21] Fix minor error using > linter-gfortran@2.1.2 lint /home/pedro/Documents/Codes/vscode-fortran-support > node ./node_modules/tslint/bin/tslint ./src/**/*.ts --- src/lib/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/helper.ts b/src/lib/helper.ts index dd3b7b12..824b1fcb 100644 --- a/src/lib/helper.ts +++ b/src/lib/helper.ts @@ -87,7 +87,7 @@ export const _loadDocString = (keyword: string) => { }; export const getIncludeParams = (paths: string[]) => { - return paths.map(path => `-I${path}`) + return paths.map(path => `-I${path}`); }; export function isPositionInString( From a39662d65a78a010587fc1c9a59b25eeb6ef8ead Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 19:50:18 +0000 Subject: [PATCH 11/21] Bump handlebars from 4.0.11 to 4.7.3 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.11 to 4.7.3. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.11...v4.7.3) Signed-off-by: dependabot[bot] --- package-lock.json | 166 +++++++++------------------------------------- 1 file changed, 33 insertions(+), 133 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18339f9a..f4841bba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linter-gfortran", - "version": "2.0.2", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -78,17 +78,6 @@ "uri-js": "^4.2.2" } }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -575,13 +564,6 @@ "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - }, "camelcase-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", @@ -612,17 +594,6 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -720,27 +691,6 @@ } } }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - } - } - }, "clone": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", @@ -2065,7 +2015,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -2330,24 +2280,39 @@ } }, "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.3.tgz", + "integrity": "sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg==", "dev": true, "requires": { - "async": "^1.4.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uglify-js": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.0.tgz", + "integrity": "sha512-ugNSTT8ierCsDHso2jkBHXYrU8Y5/fY2ZUprfrJUiD7YpuFvV4jODLFmb3h4btQjqr5Nh4TX4XtgDfCU1WdioQ==", "dev": true, + "optional": true, "requires": { - "amdefine": ">=0.0.4" + "commander": "~2.20.3", + "source-map": "~0.6.1" } } } @@ -3135,13 +3100,6 @@ "package-json": "^4.0.0" } }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, "lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", @@ -3676,12 +3634,6 @@ "wrap-ansi": "^3.0.1" } }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", @@ -3992,6 +3944,12 @@ } } }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4904,16 +4862,6 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -5761,34 +5709,6 @@ "integrity": "sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=", "dev": true }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "optional": true - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, "unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", @@ -6418,13 +6338,6 @@ "string-width": "^2.1.1" } }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -6493,19 +6406,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - }, "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", From c79dc8cda0e07653e20a23ce214a020cd7b1ffbf Mon Sep 17 00:00:00 2001 From: Pedro Ricardo C Souza Date: Tue, 25 Feb 2020 10:49:01 -0300 Subject: [PATCH 12/21] Revert "Select rank" --- syntaxes/fortran_free-form.tmLanguage.json | 43 ---------------------- 1 file changed, 43 deletions(-) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index d84b7b97..4f6cb6b1 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -1334,49 +1334,6 @@ } ] }, - { - "comment": "Select rank construct. Introduced in the Fortran 2018 standard.", - "begin": "(?i)\\s*(rank)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.rank.fortran" - } - }, - "end": "(?i)(?=\\b(end\\s*select)\\b)", - "patterns": [ - { - "include": "#parentheses" - }, - { - "begin": "(?i)\\b(rank)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.rank.fortran" - } - }, - "end": "(?i)(?=[;!\\n])", - "patterns": [ - { - "match": "(?i)\\G\\s*\\b(default)\\b", - "captures": { - "1": { - "name": "keyword.control.default.fortran" - } - } - }, - { - "include": "#parentheses" - }, - { - "include": "#invalid-word" - } - ] - }, - { - "include": "$base" - } - ] - }, { "comment": "Select type construct. Introduced in the Fortran 2003 standard.", "begin": "(?i)\\s*(type)\\b", From 1fcefd5a9b01f4816f77651a14e85cdf48bd8bcd Mon Sep 17 00:00:00 2001 From: Pedro Ricardo C Souza Date: Thu, 27 Feb 2020 08:32:59 -0300 Subject: [PATCH 13/21] Fix select highlight after & operator (#165) * Fix wrong select highlight on declarations with * Rebuild select constructs to be separated by kind (case|type|rank) --- syntaxes/fortran_free-form.tmLanguage.json | 256 +++++++++++++-------- 1 file changed, 160 insertions(+), 96 deletions(-) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 4f6cb6b1..296fbcca 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -994,7 +994,13 @@ "include": "#if-construct" }, { - "include": "#select-construct" + "include": "#select-case-construct" + }, + { + "include": "#select-type-construct" + }, + { + "include": "#select-rank-construct" }, { "include": "#where-construct" @@ -1274,121 +1280,167 @@ } ] }, - "select-construct": { + "select-case-construct":{ + "comment": "Select case construct. Introduced in the Fortran 1990 standard.", + "begin": "(?i)\\b(select)\\s*(case)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.case.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, "patterns": [ { - "name": "meta.block.select.fortran", - "begin": "(?i)\\b(select)", + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(case)\\b", "beginCaptures": { "1": { - "name": "keyword.control.select.fortran" + "name": "keyword.control.case.fortran" } }, - "end": "(?i)\\b(end\\s*select)\\b", - "endCaptures": { + "end": "(?i)(?=[;!\\n])", + "patterns": [ + { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { + "1": { + "name": "keyword.control.default.fortran" + } + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" + } + ] + }, + { + "include": "$base" + } + ] + }, + "select-type-construct":{ + "comment": "Select type construct. Introduced in the Fortran 2003 standard.", + "begin": "(?i)\\b(select)\\s*(type)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.type.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, + "patterns": [ + { + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(?:(class)|(type))", + "beginCaptures": { "1": { - "name": "keyword.control.endselect.fortran" + "name": "keyword.control.class.fortran" + }, + "2": { + "name": "keyword.control.type.fortran" } }, + "end": "(?i)(?=[;!\\n])", "patterns": [ { - "comment": "Select case construct. Introduced in the Fortran 1990 standard.", - "begin": "(?i)\\s*(case)\\b", - "beginCaptures": { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { "1": { - "name": "keyword.control.case.fortran" + "name": "keyword.control.default.fortran" } - }, - "end": "(?i)(?=\\b(end\\s*select)\\b)", - "patterns": [ - { - "include": "#parentheses" - }, - { - "begin": "(?i)\\b(case)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.case.fortran" - } - }, - "end": "(?i)(?=[;!\\n])", - "patterns": [ - { - "match": "(?i)\\G\\s*\\b(default)\\b", - "captures": { - "1": { - "name": "keyword.control.default.fortran" - } - } - }, - { - "include": "#parentheses" - }, - { - "include": "#invalid-word" - } - ] - }, - { - "include": "$base" - } - ] + } }, { - "comment": "Select type construct. Introduced in the Fortran 2003 standard.", - "begin": "(?i)\\s*(type)\\b", - "beginCaptures": { + "match": "(?i)\\G\\s*(is)\\b", + "captures": { "1": { - "name": "keyword.control.type.fortran" + "name": "keyword.control.is.fortran" } - }, - "end": "(?i)(?=\\b(end\\s*select)\\b)", - "patterns": [ - { - "include": "#parentheses" - }, - { - "begin": "(?i)\\b(?:(class)|(type))", - "beginCaptures": { - "1": { - "name": "keyword.control.class.fortran" - }, - "2": { - "name": "keyword.control.type.fortran" - } - }, - "end": "(?i)(?=[;!\\n])", - "patterns": [ - { - "match": "(?i)\\G\\s*\\b(default)\\b", - "captures": { - "1": { - "name": "keyword.control.default.fortran" - } - } - }, - { - "match": "(?i)\\G\\s*(is)\\b", - "captures": { - "1": { - "name": "keyword.control.is.fortran" - } - } - }, - { - "include": "#parentheses" - }, - { - "include": "#invalid-word" - } - ] - }, - { - "include": "$base" + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" + } + ] + }, + { + "include": "$base" + } + ] + }, + "select-rank-construct":{ + "comment": "Select rank construct. Introduced in the Fortran 2008 standard.", + "begin": "(?i)\\b(select)\\s*(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.select.fortran" + }, + "2": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=\\b(end\\s*select)\\b)", + "endCaptures": { + "1": { + "name": "keyword.control.endselect.fortran" + } + }, + "patterns": [ + { + "include": "#parentheses" + }, + { + "begin": "(?i)\\b(rank)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.rank.fortran" + } + }, + "end": "(?i)(?=[;!\\n])", + "patterns": [ + { + "match": "(?i)\\G\\s*\\b(default)\\b", + "captures": { + "1": { + "name": "keyword.control.default.fortran" } - ] + } + }, + { + "include": "#parentheses" + }, + { + "include": "#invalid-word" } ] + }, + { + "include": "$base" } ] }, @@ -2110,6 +2162,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4070,6 +4125,9 @@ { "include": "#types" }, + { + "include": "#line-continuation-operator" + }, { "comment": "Attribute list.", "contentName": "meta.attribute-list.fortran", @@ -4148,6 +4206,9 @@ "include": "#invalid-word" } ] + }, + { + "include": "#line-continuation-operator" } ] }, @@ -4939,6 +5000,9 @@ }, { "include": "#variable" + }, + { + "include": "#line-continuation-operator" } ] }, From 7914b9754b35e33b4925b60aa11e5491ce5bb12d Mon Sep 17 00:00:00 2001 From: "Pedro Ricardo C. Souza" Date: Thu, 27 Feb 2020 09:03:44 -0300 Subject: [PATCH 14/21] Update Changelog and package version --- CHANGELOG.md | 16 +++++++++++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a202a6..aeed226e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [2.1.1] - 2019-xx-xx +## [2.2.0] - 2020-02-27 + +### Changed + +- Improve syntax highlight (#149, #166) +- Fix Symbols in VSCode ^1.4x (#154, #140, #151) +- Dependencies Update (#144, #146, #155) +- Improve code completion (#148) + +### Added + +- More custom settings (#152) +- Breakpoints support (#150) + +## [2.1.1] - 2019-06-03 ### Changed diff --git a/package-lock.json b/package-lock.json index 45eec274..d3478555 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linter-gfortran", - "version": "2.1.1", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b545b057..4cc8f037 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "linter-gfortran", "displayName": "Modern Fortran", "description": "Modern Fortran language support, including syntax highlighting and error detection.", - "version": "2.1.2", + "version": "2.2.0", "publisher": "krvajalm", "engines": { "vscode": "^1.30.x" From 1fd49fdc0a31dff620365b1277abcc61d7dffffa Mon Sep 17 00:00:00 2001 From: GNikit Date: Fri, 28 Feb 2020 21:04:12 +0000 Subject: [PATCH 15/21] Added debugging functionality. (#150) * Added debugging functionality. * Replaces deprecated debugger interface. As stated in issue #9037 in github.com/microsoft/vscode is the way to go. Fortran does not do anything different from the inhouse C++ debugger, hence we should only have the extension allow breaking points and nothing else. This of course means that we will be depending on Microsoft's C++ extension for the debugger. * Updated README.md to include debugging as feature * Marked code snippets as JSON * Attempt to fix highlighting on GitHub --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++----- package.json | 16 +++++++++++-- 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2d7a1be7..ec0f58b4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Installs](https://vsmarketplacebadge.apphb.com/installs/krvajalm.linter-gfortran.svg)](https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran) [![GitHub release](https://img.shields.io/github/release/krvajal/vscode-fortran-support.svg)](https://GitHub.com/krvajal/vscode-fortran-support/releases/) -> This extension provides support for the Fortran programming language. It includes syntax highlighting, code snippets and a linting based on `gfortran`. You can download the Visual Studio Code editor from [here](https://code.visualstudio.com/download). +> This extension provides support for the Fortran programming language. It includes syntax highlighting, debugging, code snippets and a linting based on `gfortran`. You can download the Visual Studio Code editor from [here](https://code.visualstudio.com/download). ## Features @@ -16,6 +16,7 @@ - Code linting based on `gfortran` to show errors wiggles in your code - Code autocompletion (beta) - Symbols provider +- Debugger, uses Microsoft's [C/C++ extension](https://github.com/Microsoft/vscode-cpptools) ![symbol_nav](./doc/symbol_nav.png) @@ -23,7 +24,7 @@ You can control the include paths to be used by the linter with the `fortran.includePaths` setting. -``` +``` jsonc { "fortran.includePaths": [ "/usr/local/include", @@ -34,7 +35,7 @@ You can control the include paths to be used by the linter with the `fortran.inc By default the `gfortran` executable is assumed to be found in the path. In order to use a different one or if it can't be found in the path you can point the extension to use a custom one with the `fortran.gfortranExecutable` setting. -``` +``` jsonc { "fortran.gfortranExecutable": '/usr/local/bin/gfortran-4.7', } @@ -42,7 +43,7 @@ By default the `gfortran` executable is assumed to be found in the path. In orde If you want to pass extra options to the `gfortran` executable or override the default one, you can use the setting `fortran.linterExtraArgs`. By default `-Wall` is the only option. -``` +``` jsonc { "fortran.linterExtraArgs": ['-Wall'], } @@ -50,7 +51,7 @@ If you want to pass extra options to the `gfortran` executable or override the d You can configure what kind of symbols will appear in the symbol list by using -``` +``` jsonc { "fortran.symbols": [ "function", "subroutine"] } @@ -68,7 +69,7 @@ and by default only functions and subroutines are shown You can also configure the case for fortran intrinsics auto-complete by using -``` +``` jsonc { "fortran.preferredCase": "lowercase" | "uppercase" } @@ -90,10 +91,65 @@ This is a list of some of the snippets included, if you like to include addition To trigger code validations you must save the file first. +## Debugging + +The extension uses the debugger from Microsoft's +[C/C++ extension](https://github.com/Microsoft/vscode-cpptools) +for Visual Studio Code. This allows this extension to use the full functionality +of the C/C++ extension for debugging applications: +(un)conditional breaking points, expression evaluation, multi-threaded debugging, +call stack, stepping, watch window. + +A minimal `launch.json` script, responsible for controlling the debugger, is +provided below. However, Visual Studio Code is also capable of autogenerating +a `launch.json` file and the configurations inside the file. + +More details about how to setup the debugger can be found in Microsoft's website: + +- General information about debugging in VS Code: +- C/C++ extension debugger information: +- Build tasks for easy compiling: + +``` jsonc +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Fortran", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/a.out", + "args": [], // Possible input args for a.out + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} +``` + ## Requirements For the linter to work you need to have `gfortran` on your path, or wherever you configure it to be. +For debugging you need to have one of the following debuggers installed: + +- **Linux**: GDB +- **macOS**: GDB or LLDB +- **Windows**: GDB or Visual Studio Windows Debugger + ## Issues Please report any issues and feature request on the GitHub repo [here](https://github.com/krvajalmiguelangel/vscode-fortran-support/issues/new) diff --git a/package.json b/package.json index 4cc8f037..bfda8a62 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,16 @@ "categories": [ "Programming Languages", "Snippets", - "Linters" + "Linters", + "Debuggers" ], "activationEvents": [ "onLanguage:FortranFreeForm" ], "main": "./out/src/extension", + "extensionDependencies": [ + "ms-vscode.cpptools" + ], "contributes": { "languages": [ { @@ -84,6 +88,14 @@ "path": "./snippets/fortran90.json" } ], + "breakpoints": [ + { + "language": "FortranFreeForm" + }, + { + "language": "fortran_fixed-form" + } + ], "configuration": { "type": "object", "title": "Fortran configuration", @@ -197,4 +209,4 @@ "dependencies": { "vscode-languageclient": "^5.1.0" } -} +} \ No newline at end of file From bfa4bb0c17294876abbc3e90772765b09144ba23 Mon Sep 17 00:00:00 2001 From: Christopher Bradley Date: Sat, 11 Apr 2020 05:59:29 +0100 Subject: [PATCH 16/21] Fix in-line forall highlighting --- syntaxes/fortran_free-form.tmLanguage.json | 43 +++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/syntaxes/fortran_free-form.tmLanguage.json b/syntaxes/fortran_free-form.tmLanguage.json index 4f6cb6b1..7bf0a826 100644 --- a/syntaxes/fortran_free-form.tmLanguage.json +++ b/syntaxes/fortran_free-form.tmLanguage.json @@ -1456,26 +1456,21 @@ }, "forall-construct": { "comment": "Introduced in the Fortran 1995 standard.", - "contentName": "meta.block.forall.fortran", - "begin": "(?i)\\s*\\b(forall)\\b", - "beginCaptures":{ + "begin": "(?i)\\b(forall)\\b", + "beginCaptures": { "1": { "name": "keyword.control.forall.fortran" } }, - "end": "(?i)\\s*\\b(end\\s*forall)\\b", - "endCaptures": { - "1": { - "name": "keyword.control.endforall.fortran" - } - }, - "patterns":[ + "end": "(? Date: Sat, 11 Apr 2020 09:34:34 -0300 Subject: [PATCH 17/21] Update CHANGELOG. --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeed226e..2bf5a454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [2.2.0] - 2020-02-27 +## [2.2.0] - 2020-04-11 ### Changed -- Improve syntax highlight (#149, #166) +- Improve syntax highlight (#149, #166, #169) - Fix Symbols in VSCode ^1.4x (#154, #140, #151) - Dependencies Update (#144, #146, #155) - Improve code completion (#148) From 6b77f56d5afbb71ff8f5bb255a3a899134ae8904 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Sun, 19 Apr 2020 15:35:53 -0400 Subject: [PATCH 18/21] towards adding more test coverage --- .vscode/launch.json | 25 +++++++++++++++++++------ package-lock.json | 2 +- package.json | 2 +- test/extension.test.ts | 7 +++---- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f700a891..cb6ce3ea 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,10 +7,14 @@ "type": "extensionHost", "request": "launch", "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], "stopOnEntry": false, "sourceMaps": true, - "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ], + "outFiles": [ + "${workspaceFolder}/out/src/**/*.js" + ], "preLaunchTask": "npm" }, { @@ -18,11 +22,20 @@ "type": "extensionHost", "request": "launch", "runtimeExecutable": "${execPath}", - "args": ["test/resources/sample.f90","--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], + "env": { + "CODE_TESTS_WORKSPACE": "./" + }, + "args": [ + "test/resources/sample.f90", + "--disable-extensions", + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test" + ], "stopOnEntry": false, "sourceMaps": true, - "outFiles": [ "${workspaceRoot}/out/test/**/*.js" ], - "preLaunchTask": "npm" + "outFiles": [ + "${workspaceFolder}/out/test/**/*.js" + ] } ] -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d3478555..67de1d61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2015,7 +2015,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { diff --git a/package.json b/package.json index bfda8a62..76415b56 100644 --- a/package.json +++ b/package.json @@ -209,4 +209,4 @@ "dependencies": { "vscode-languageclient": "^5.1.0" } -} \ No newline at end of file +} diff --git a/test/extension.test.ts b/test/extension.test.ts index a034bc80..256ce0b3 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -5,19 +5,18 @@ // The module 'assert' provides assertion methods from node import * as assert from "assert"; -import * as fs from "fs"; // You can import and use all API from the 'vscode' module // as well as import your extension to test it import * as vscode from "vscode"; -import * as myExtension from "../src/extension"; +import * as path from 'path'; import { FortranDocumentSymbolProvider } from "../src/features/document-symbol-provider"; // Defines a Mocha test suite to group tests of similar kind together suite("Extension Tests", () => { test("symbol provider works as expected", async () => { - const filePath = "/test/resources/sample.f90"; - const openPath = vscode.Uri.file(`${vscode.workspace.rootPath}${filePath}`); + const filePath = path.resolve(__dirname, "../..//test/resources/sample.f90"); + const openPath = vscode.Uri.file(filePath); const doc = await vscode.workspace.openTextDocument(openPath); vscode.window.showTextDocument(doc); const symbolProvider = new FortranDocumentSymbolProvider(); From c61a2003b395d8549a1df30f8d2948dacbf760b7 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Sun, 19 Apr 2020 15:38:56 -0400 Subject: [PATCH 19/21] undo package json changes --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67de1d61..d3478555 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2015,7 +2015,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { diff --git a/package.json b/package.json index 76415b56..bfda8a62 100644 --- a/package.json +++ b/package.json @@ -209,4 +209,4 @@ "dependencies": { "vscode-languageclient": "^5.1.0" } -} +} \ No newline at end of file From 52af5172ad8fc72c466f21d620516114c1092e71 Mon Sep 17 00:00:00 2001 From: Kyle Thompson Date: Sun, 19 Apr 2020 15:43:26 -0400 Subject: [PATCH 20/21] fix extra slash --- test/extension.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/extension.test.ts b/test/extension.test.ts index 256ce0b3..8f48b155 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -15,7 +15,7 @@ import { FortranDocumentSymbolProvider } from "../src/features/document-symbol-p // Defines a Mocha test suite to group tests of similar kind together suite("Extension Tests", () => { test("symbol provider works as expected", async () => { - const filePath = path.resolve(__dirname, "../..//test/resources/sample.f90"); + const filePath = path.resolve(__dirname, "../../test/resources/sample.f90"); const openPath = vscode.Uri.file(filePath); const doc = await vscode.workspace.openTextDocument(openPath); vscode.window.showTextDocument(doc); From 4fe630f6f030ecc14f0c0f3f951a7346a4587c3c Mon Sep 17 00:00:00 2001 From: Pedro Ricardo C Souza Date: Tue, 5 May 2020 19:49:39 -0300 Subject: [PATCH 21/21] Update README to fix #174 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec0f58b4..0b561f16 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ By default the `gfortran` executable is assumed to be found in the path. In orde ``` jsonc { - "fortran.gfortranExecutable": '/usr/local/bin/gfortran-4.7', + "fortran.gfortranExecutable": "/usr/local/bin/gfortran-4.7", } ``` @@ -45,7 +45,7 @@ If you want to pass extra options to the `gfortran` executable or override the d ``` jsonc { - "fortran.linterExtraArgs": ['-Wall'], + "fortran.linterExtraArgs": ["-Wall"], } ```