-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #422
- Loading branch information
Showing
8 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as vscode from 'vscode'; | ||
import * as path from 'path'; | ||
import { strictEqual } from 'assert'; | ||
import { spawnSync } from 'child_process'; | ||
import { LoggingService } from '../src/services/logging-service'; | ||
import { FortlsClient } from '../src/lsp/client'; | ||
|
||
suite('Language Server integration tests', () => { | ||
let doc: vscode.TextDocument; | ||
const server = new FortlsClient(new LoggingService()); | ||
const fileUri = vscode.Uri.file( | ||
path.resolve(__dirname, '../../test/resources/function_subroutine_definitions.f90') | ||
); | ||
|
||
suiteSetup(async function (): Promise<void> { | ||
console.log('Installing fortls Language Server'); | ||
spawnSync('pip', ['install', '--user', '--upgrade', 'fortls']); | ||
}); | ||
|
||
test('Launch fortls & Check Initialization Response', async () => { | ||
await server.activate(); | ||
doc = await vscode.workspace.openTextDocument(fileUri); | ||
await vscode.window.showTextDocument(doc); | ||
|
||
const ref = { | ||
capabilities: { | ||
completionProvider: { | ||
resolveProvider: false, | ||
triggerCharacters: ['%'], | ||
}, | ||
definitionProvider: true, | ||
documentSymbolProvider: true, | ||
referencesProvider: true, | ||
hoverProvider: true, | ||
implementationProvider: true, | ||
renameProvider: true, | ||
workspaceSymbolProvider: true, | ||
textDocumentSync: 2, | ||
signatureHelpProvider: { | ||
triggerCharacters: ['(', ','], | ||
}, | ||
codeActionProvider: true, | ||
}, | ||
}; | ||
strictEqual(JSON.stringify(ref) === JSON.stringify(server['client'].initializeResult), true); | ||
}); | ||
|
||
suiteTeardown(async function (): Promise<void> { | ||
console.log('Deactivate fortls'); | ||
await server.deactivate(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
// 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": "Launch current F90", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${fileDirname}/${fileBasenameNoExtension}", | ||
"cwd": "${fileDirname}", | ||
"stopAtEntry": false, | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "compile", | ||
"logging": { | ||
"engineLogging": false, | ||
"moduleLoad": true, | ||
"exceptions": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "compile", | ||
"type": "shell", | ||
"command": "gfortran", | ||
"args": ["-Wall", "-g", "${file}", "-o${fileDirname}/${fileBasenameNoExtension}"], | ||
"presentation": { | ||
"echo": true, | ||
"reveal": "always", | ||
"focus": false, | ||
"panel": "shared" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": "$gcc" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters