FORTRAN Language Server for the Language Server Protocol
Project description
A Fortran implementation of the Language Server Protocol using Python (2.7+).
Editor extensions using this language server to provide autocomplete and other IDE-like functionality are available for Atom and Visual Studio Code.
Note: This language server is currently in the early stages of development. Not all features are supported or planned.
Language Server Features
Document Symbols:
Auto Completion:
Go to definition:
Hover:
Find references:
Note: Currently for global and top level module objects only.
Diagnostics:
Multiple use of the same variable name
Unknown module in USE statement
Variable masking definition from parent scope
Installation
pip install fortran-language-server
Language server settings
The following global settings can be used when launching the language server.
--symbol_skip_mem Do not include type members in document symbol results
--incrmental_sync Use incremental document synchronization (beta)
--autocomplete_no_prefix Do not filter autocomplete results by variable prefix
Debug settings:
The following settings can be used to perform standalone debug tests on the language server.
--debug_filepath=DEBUG_FILEPATH Path to file for file specific tests
--debug_rootpath=DEBUG_ROOTPATH Root path for language server tests
--debug_parser Test source parser on specified file instead of running language server
--debug_symbols Test symbol generation for specified file instead of running language server
Configuration
Project specific settings can be specified by placing a JSON file named .fortls (example below) in the root_dir directory.
Setup module search paths:
By default all files with the suffix F,F77,F90,F95,F03,F08,FOR,FPP (case-insensitive) in the root_dir directory, specified during initialization, and all its sub-directories are parsed and included in the project.
Directories and files can be excluded from the project by specifying their paths (relative to root_dir) in the excl_paths variable in the .fortls file. Excluded directories also exclude all sub-directories.
Module directories can also be specified manually by specifying their paths (relative to root_dir) in the mod_dirs variable in the .fortls file. When mod_dirs is specified directories are not added recursively, so any nested sub directories must be explicitly listed. However, root_dir does not need to be specified manually as it is always included.
{ "mod_dirs": ["subdir1", "subdir2"], "excl_paths": ["subdir3", "subdir1/file_to_skip.F90"] }
Bug reports
When filing bugs please provide example code to reproduce the observed issue.
License
This project is made available under the MIT License.
Support
If you really like this package you can buy me a coffee to say thanks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fortran-language-server-0.5.0.tar.gz
.
File metadata
- Download URL: fortran-language-server-0.5.0.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06109960b5ac1a0e9672360d1564a0b41e1ea13f78c6056052c2595f89278096 |
|
MD5 | 0436151f66a16eb997e374f05b07f4ea |
|
BLAKE2b-256 | 6d7f5ab38c30269bf21fd774b943b7cdc732c82e7f196fe54699114b078f5a5d |