-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental support for code assistance using a language server (#…
…90) Added basic support for using the language sever protocol with the [fortran-languague-server](https://github.com/hansec/fortran-language-server) This is still an experimental feature and contains several bugs. But the idea is to get it out there as fast as possible and fix the bug later on.
- Loading branch information
Showing
9 changed files
with
582 additions
and
518 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,45 @@ | ||
import { | ||
LanguageClient, | ||
LanguageClientOptions, | ||
Executable, | ||
} from 'vscode-languageclient' | ||
import { getBinPath, FORTRAN_FREE_FORM_ID } from './lib/helper' | ||
|
||
class FortranLangServer { | ||
c: LanguageClient | ||
constructor(context, config) { | ||
let langServerFlags: string[] = config.get('languageServerFlags', []) | ||
|
||
const serverOptions: Executable = { | ||
command: getBinPath('fortran-langserver'), | ||
args: [...langServerFlags], | ||
options: {}, | ||
} | ||
|
||
const clientOptions: LanguageClientOptions = { | ||
documentSelector: [FORTRAN_FREE_FORM_ID], | ||
} | ||
|
||
this.c = new LanguageClient( | ||
'fortran-langserver', | ||
serverOptions, | ||
clientOptions | ||
) | ||
} | ||
|
||
start() { | ||
this.c.start() | ||
} | ||
|
||
onReady() { | ||
return this.c.onReady() | ||
} | ||
|
||
getCapabilities() { | ||
const capabilities = | ||
this.c.initializeResult && this.c.initializeResult.capabilities | ||
return capabilities | ||
} | ||
} | ||
|
||
export { FortranLangServer } |
Oops, something went wrong.