Skip to content

Commit a84bb75

Browse files
author
Jeff Larkin
committed
Merge branch 'master' into openacc
2 parents 6f5b23e + 8ab40b2 commit a84bb75

19 files changed

+5045
-268
lines changed

.github/workflows/main.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on: [push]
2+
jobs:
3+
grammar:
4+
runs-on: ubuntu-20.04
5+
strategy:
6+
matrix:
7+
node-version: [12.x]
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Use Node.js ${{ matrix.node-version }}
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: ${{ matrix.node-version }}
14+
- run: yarn install
15+
- run: yarn test:grammar
16+
17+

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,33 @@
88

99
// A task runner that calls a custom npm script that compiles the extension.
1010
{
11-
"version": "0.1.0",
11+
"version": "2.0.0",
1212

1313
// we want to run npm
1414
"command": "npm",
1515

16-
// the command is a shell script
17-
"isShellCommand": true,
18-
19-
// show the output window only if unrecognized errors occur.
20-
"showOutput": "silent",
21-
2216
// we run the custom script "compile" as defined in package.json
2317
"args": ["run", "compile", "--loglevel", "silent"],
2418

2519
// The tsc compiler is started in watching mode
2620
"isBackground": true,
2721

2822
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29-
"problemMatcher": "$tsc-watch"
23+
"problemMatcher": "$tsc-watch",
24+
"tasks": [
25+
{
26+
"label": "npm",
27+
"type": "shell",
28+
"command": "npm",
29+
"args": [
30+
"run",
31+
"compile",
32+
"--loglevel",
33+
"silent"
34+
],
35+
"isBackground": true,
36+
"problemMatcher": "$tsc-watch",
37+
"group": "build"
38+
}
39+
]
3040
}

.vscode/tasks.json.old

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
9+
// A task runner that calls a custom npm script that compiles the extension.
10+
{
11+
"version": "0.1.0",
12+
13+
// we want to run npm
14+
"command": "npm",
15+
16+
// the command is a shell script
17+
"isShellCommand": true,
18+
19+
// show the output window only if unrecognized errors occur.
20+
"showOutput": "silent",
21+
22+
// we run the custom script "compile" as defined in package.json
23+
"args": ["run", "compile", "--loglevel", "silent"],
24+
25+
// The tsc compiler is started in watching mode
26+
"isBackground": true,
27+
28+
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29+
"problemMatcher": "$tsc-watch"
30+
}

package-lock.json

Lines changed: 24 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,14 @@
184184
"compile": "tsc -watch -p ./",
185185
"postinstall": "node ./node_modules/vscode/bin/install",
186186
"test": "CODE_TESTS_WORKSPACE='./' node ./node_modules/vscode/bin/test",
187+
"test:grammar": "vscode-tmgrammar-snap -s source.fortran.free -g ./syntaxes/fortran_free-form.tmLanguage.json -t \"./test/resources/*.f90\"",
187188
"lint": "node ./node_modules/tslint/bin/tslint ./src/**/*.ts "
188189
},
189190
"devDependencies": {
190191
"@types/fs-extra": "0.0.35",
191192
"@types/glob": "^5.0.30",
192193
"@types/mocha": "^2.2.32",
193-
"@types/node": "^6.0.40",
194+
"@types/node": "^15.12.1",
194195
"decache": "^4.1.0",
195196
"fs-extra": "^1.0.0",
196197
"glob": "^7.1.1",
@@ -201,7 +202,8 @@
201202
"remap-istanbul": "^0.8.4",
202203
"tslint": "^4.0.2",
203204
"typescript": "^3.5.1",
204-
"vscode": "^1.1.37"
205+
"vscode": "^1.1.37",
206+
"vscode-tmgrammar-test": "^0.0.11"
205207
},
206208
"husky": {
207209
"hooks": {

src/extension.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,39 @@ import { FortranDocumentSymbolProvider } from './features/document-symbol-provid
88

99
import { FORTRAN_FREE_FORM_ID, EXTENSION_ID } from './lib/helper'
1010
import { FortranLangServer, checkForLangServer } from './lang-server'
11-
11+
import { LoggingService } from './services/logging-service'
12+
import * as pkg from '../package.json'
1213

1314
export function activate(context: vscode.ExtensionContext) {
14-
15+
const loggingService = new LoggingService()
1516
const extensionConfig = vscode.workspace.getConfiguration(EXTENSION_ID)
1617

18+
loggingService.logInfo(`Extension Name: ${pkg.displayName}`)
19+
loggingService.logInfo(`Extension Version: ${pkg.version}`)
20+
1721
if (extensionConfig.get('linterEnabled', true)) {
18-
let linter = new FortranLintingProvider()
22+
let linter = new FortranLintingProvider(loggingService)
1923
linter.activate(context.subscriptions)
2024
vscode.languages.registerCodeActionsProvider(FORTRAN_FREE_FORM_ID, linter)
25+
} else {
26+
loggingService.logInfo('Linter is not enabled')
2127
}
2228

2329
if (extensionConfig.get('provideCompletion', true)) {
24-
let completionProvider = new FortranCompletionProvider()
30+
let completionProvider = new FortranCompletionProvider(loggingService)
2531
vscode.languages.registerCompletionItemProvider(
2632
FORTRAN_FREE_FORM_ID,
2733
completionProvider
2834
)
35+
} else {
36+
loggingService.logInfo('Completion Provider is not enabled')
2937
}
3038

3139
if (extensionConfig.get('provideHover', true)) {
32-
let hoverProvider = new FortranHoverProvider()
33-
vscode.languages.registerHoverProvider(
34-
FORTRAN_FREE_FORM_ID,
35-
hoverProvider
36-
)
40+
let hoverProvider = new FortranHoverProvider(loggingService)
41+
vscode.languages.registerHoverProvider(FORTRAN_FREE_FORM_ID, hoverProvider)
42+
} else {
43+
loggingService.logInfo('Hover Provider is not enabled')
3744
}
3845

3946
if (extensionConfig.get('provideSymbols', true)) {
@@ -42,10 +49,11 @@ export function activate(context: vscode.ExtensionContext) {
4249
FORTRAN_FREE_FORM_ID,
4350
symbolProvider
4451
)
52+
} else {
53+
loggingService.logInfo('Symbol Provider is not enabled')
4554
}
4655

4756
if (checkForLangServer(extensionConfig)) {
48-
4957
const langServer = new FortranLangServer(context, extensionConfig)
5058
langServer.start()
5159
langServer.onReady().then(() => {

0 commit comments

Comments
 (0)