6
6
[ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
7
7
8
8
` fortls ` is an implementation of the [ Language Server Protocol] ( https://github.com/Microsoft/language-server-protocol )
9
- (LSP) for Fortran using Python (3.6 +).
9
+ (LSP) for Fortran using Python (3.7 +).
10
10
11
11
Editor extensions that can integrate with ` fortls ` to provide autocomplete and
12
12
other IDE-like functionality are available for
@@ -28,29 +28,30 @@ potentially subject to change.
28
28
29
29
## Features
30
30
31
- - Document symbols (` textDocument/documentSymbol ` )
32
- - Auto-complete (` textDocument/completion ` )
33
- - Signature help (` textDocument/signatureHelp ` )
34
- - GoTo/Peek definition (` textDocument/definition ` )
35
- - Hover (` textDocument/hover ` )
36
- - GoTo implementation (` textDocument/implementation ` )
37
- - Find/Peek references (` textDocument/references ` )
38
- - Project-wide symbol search (` workspace/symbol ` )
31
+ - Project-wide and Document symbol detection and Renaming
32
+ - Hover support, Signature help and Auto-completion
33
+ - GoTo/Peek implementation and Find/Peek references
39
34
- Symbol renaming (` textDocument/rename ` )
40
35
- Documentation parsing ([ Doxygen] ( http://www.doxygen.org/ ) and
41
36
[ FORD] ( https://github.com/Fortran-FOSS-Programmers/ford ) styles)
42
- - Diagnostics (limited)
37
+ - Access to multiple intrinsic modules and functions
38
+ - ` ISO_FORTRAN_ENV ` GCC 11.2.0
39
+ - ` IOS_C_BINDING ` GCC 11.2.0
40
+ - ` IEEE_EXCEPTIONS ` , ` IEEE_ARITHMETIC ` , ` IEEE_FEATURES ` GCC 11.2.0
41
+ - OpenMP ` OMP_LIB ` , ` OMP_LIB_KINDS ` v5.0
42
+ - OpenACC ` OPENACC ` , ` OPENACC_KINDS ` v3.1
43
+ - Diagnostics
43
44
- Multiple definitions with the same variable name
44
45
- Variable definition masks definition from parent scope
45
46
- Missing subroutine/function arguments
46
- - Unknown user-defined type used in " TYPE"/" CLASS" definition
47
+ - Unknown user-defined type used in ` TYPE ` / ` CLASS ` definition
47
48
(only if visible in project)
48
49
- Unclosed blocks/scopes
49
50
- Invalid scope nesting
50
- - Unknown modules in " USE" statement
51
+ - Unknown modules in ` USE ` statement
51
52
- Unimplemented deferred type-bound procedures
52
53
- Use of unimported variables/objects in interface blocks
53
- - Statement placement errors (" CONTAINS", " IMPLICIT", " IMPORT" )
54
+ - Statement placement errors (` CONTAINS ` , ` IMPLICIT ` , ` IMPORT ` )
54
55
- Code actions (` textDocument/codeAction ` ) \[ Experimental\]
55
56
- Generate type-bound procedures and implementation templates for
56
57
deferred procedures
@@ -59,14 +60,15 @@ potentially subject to change.
59
60
60
61
- Signature help is not available for overloaded subroutines/functions
61
62
- Diagnostics are only updated when files are saved or opened/closed
63
+ - Files included for preprocessor are not parsed for Fortran objects
62
64
63
65
## Installation
64
66
65
67
``` sh
66
68
pip install fortls
67
69
```
68
70
69
- ## fortls settings
71
+ ## Settings
70
72
71
73
The following global settings can be used when launching the language
72
74
server.
@@ -155,6 +157,7 @@ All command line options are also available through the **options** file as well
155
157
- ` max_line_length ` Maximum line length (default: none)
156
158
- ` max_comment_line_length ` Maximum comment line length (default:
157
159
none)
160
+ - ` incl_suffixes ` Add more Fortran extensions to be parsed by the server
158
161
159
162
## Additional settings
160
163
@@ -184,6 +187,7 @@ By default all source directories under `root_dir` are recursively included.
184
187
Source file directories can also be specified manually by specifying
185
188
their paths in the ` source_dirs ` variable in the configuration options file.
186
189
Paths can be absolute or relative to ` root_dir ` .
190
+ ` root_dir ` does not need to be specified manually as it is always included.
187
191
188
192
When defining ` source_dirs ` in the configuration options filethe default behaviour (i.e. including
189
193
all files in all subdirectories under ` root_dir ` ) is overriden. To include them
@@ -195,8 +199,6 @@ back again one can do
195
199
}
196
200
```
197
201
198
- > NOTE: ` root_dir ` does not need to be specified manually as it is always included.
199
-
200
202
### Preprocessing
201
203
202
204
** Note:** Preprocessor support is not "complete", see below. For
@@ -278,6 +280,19 @@ Diagnostics:
278
280
279
281
 -->
280
282
283
+ ## Implemented server requests
284
+
285
+ | Request | Description |
286
+ | ----------------------------- | ------------------------------------------------------ |
287
+ | ` workspace/symbol ` | Get workspace-wide symbols |
288
+ | ` textDocument/documentSymbol ` | Get document symbols e.g. functions, subroutines, etc. |
289
+ | ` textDocument/completion ` | Suggested tab-completion when typing |
290
+ | ` textDocument/signatureHelp ` | Get signature information at a given cursor position |
291
+ | ` textDocument/definition ` | GoTo implementation/Peek implementation |
292
+ | ` textDocument/references ` | Find all/Peek references |
293
+ | ` textDocument/rename ` | Rename a symbol across the workspace |
294
+ | ` textDocument/codeAction ` | ** Experimental** Generate code |
295
+
281
296
## Acknowledgements
282
297
283
298
This project would not have been possible without the original work of [ @hansec ] ( https://github.com/hansec/ )
0 commit comments