Skip to content

Commit c408931

Browse files
committed
Updated setup.cfg and docs
1 parent abd7f39 commit c408931

File tree

5 files changed

+137
-24
lines changed

5 files changed

+137
-24
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELONG
22

3+
## 2.2.5
4+
5+
### Changed
6+
7+
- Updated `setup.cfg` in preparation of submitting package to `conda-forge`
8+
- Added `Editor Integration` section in documentation
9+
310
## 2.2.4
411

512
### Fixed

README.md

+28-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# fortls - the Fortran Language Server
1+
# fortls - Fortran Language Server
22

33
![PyPI](https://img.shields.io/pypi/v/fortls)
44
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fortls)
@@ -11,15 +11,17 @@
1111
`fortls` is an implementation of the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol)
1212
(LSP) for Fortran using Python (3.7+).
1313

14-
Editor extensions that can integrate with `fortls` to provide autocomplete and
15-
other IDE-like functionality are available for
16-
[Visual Studio Code](https://github.com/krvajal/vscode-fortran-support),
17-
[Atom](https://atom.io/packages/ide-fortran),
18-
[Visual Studio](https://github.com/michaelkonecny/vs-fortran-ls-client),
19-
[(Neo)vim](https://github.com/hansec/fortran-language-server/wiki/Using-forts-with-vim),
20-
and [Emacs](https://github.com/emacs-lsp/lsp-mode).
14+
All code editors that support LSP can integrate with `fortls` see the section
15+
[Editor Integration](https://gnikit.github.io/fortls/editor_integration.html#editor-integration) in the documentation.
16+
Some supported code editors include:
17+
[Visual Studio Code](https://gnikit.github.io/fortls/editor_integration.html#visual-studio-code),
18+
[Atom](https://gnikit.github.io/fortls/editor_integration.html#atom),
19+
[Sublime Text](https://gnikit.github.io/fortls/editor_integration.html#sublime-text)
20+
[(Neo)Vim](https://gnikit.github.io/fortls/editor_integration.html#vim-neovim-gvim),
21+
[Visual Studio](https://gnikit.github.io/fortls/editor_integration.html#visual-studio-2017),
22+
and [Emacs](https://gnikit.github.io/fortls/editor_integration.html#emacs).
2123

22-
## fortls vs fortran-language-server
24+
## `fortls` vs `fortran-language-server`
2325

2426
This project is based on @hansec's original Language Server implementation but the two projects have since diverged.
2527
`fortls` (this project) is now developed independently of the upstream `hansec/fortran-language-server` project and contains numerous bug fixes and new features
@@ -56,32 +58,30 @@ potentially subject to change.
5658
- Invalid scope nesting
5759
- Unknown modules in `USE` statement
5860
- Unimplemented deferred type-bound procedures
59-
- Use of unimported variables/objects in interface blocks
61+
- Use of non-imported variables/objects in interface blocks
6062
- Statement placement errors (`CONTAINS`, `IMPLICIT`, `IMPORT`)
61-
- Code actions (`textDocument/codeAction`) \[Experimental\]
63+
- Code actions
6264
- Generate type-bound procedures and implementation templates for
6365
deferred procedures
6466

6567
### Notes/Limitations
6668

67-
- Signature help is not available for overloaded subroutines/functions
68-
- Diagnostics are only updated when files are saved or opened/closed
69+
- Signature help and hover does not handle elegantly overloaded functions i.e. interfaces
6970

7071
## Installation
7172

7273
```sh
7374
pip install fortls
7475
```
7576

76-
>**Warning**: it is not recommended having `fortls` and `fortran-language-server`
77-
>simultaneously installed, since they use the same binary name. If you are having trouble
78-
>getting `fortls` to work try uninstalling `fortran-language-server` and reinstalling `fortls`.
77+
> **Warning**: it is not recommended having `fortls` and `fortran-language-server`
78+
> simultaneously installed, since they use the same binary name. If you are having trouble
79+
> getting `fortls` to work try uninstalling `fortran-language-server` and reinstalling `fortls`.
7980
>
80-
>```sh
81-
>pip uninstall fortran-language-server
82-
>pip install fortls --upgrade
83-
>```
84-
81+
> ```sh
82+
> pip uninstall fortran-language-server
83+
> pip install fortls --upgrade
84+
> ```
8585
8686
## Settings
8787
@@ -115,9 +115,15 @@ An example for a Configuration file is given below
115115
| `textDocument/documentSymbol` | Get document symbols e.g. functions, subroutines, etc. |
116116
| `textDocument/completion` | Suggested tab-completion when typing |
117117
| `textDocument/signatureHelp` | Get signature information at a given cursor position |
118-
| `textDocument/definition` | GoTo implementation/Peek implementation |
118+
| `textDocument/definition` | GoTo definition/Peek definition |
119119
| `textDocument/references` | Find all/Peek references |
120+
| `textDocument/hover` | Show messages and signatures upon hover |
121+
| `textDocument/implementation` | GoTo implementation/Peek implementation |
120122
| `textDocument/rename` | Rename a symbol across the workspace |
123+
| `textDocument/didOpen` | Document synchronisation upon opening |
124+
| `textDocument/didSave` | Document synchronisation upon saving |
125+
| `textDocument/didClose` | Document synchronisation upon closing |
126+
| `textDocument/didChange` | Document synchronisation upon changes to the document |
121127
| `textDocument/codeAction` | **Experimental** Generate code |
122128
123129
## Acknowledgements

docs/editor_integration.rst

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Editor Integration
2+
===================
3+
4+
Visual Studio Code
5+
------------------
6+
7+
The Language Server is natively supported through the `Modern Fortran`_ extension.
8+
Install ``fortls`` then install the extension and all of the server's features should be instantly available.
9+
10+
.. _Modern Fortran: https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran
11+
12+
.. note::
13+
Make sure that ``fortls`` is reachable in your ``$PATH``. If not you can specify the option
14+
``"fortran.fortls.path": "/custom/path/to/fortls"``
15+
16+
Atom
17+
----
18+
19+
Firstly ``fortls`` then install the `language-fortran`_ plugin by `@dparkins`_ to get Fortran syntax highlighting.
20+
Finally, install either `fortran-lsp`_ by `@gnikit`_ or `ide-fortran`_ by `@hansec`_
21+
22+
.. warning::
23+
`fortran-lsp`_ has been created solely for the ``fortls`` Language Server, hence it natively interfaces with ``fortls``.
24+
`ide-fortran`_ was created for an older, now deprecated, Fortran Language Server hence the options
25+
available through the extension are not representative of ``fortls``'s interface.
26+
27+
.. _language-fortran: https://atom.io/packages/language-fortran
28+
.. _@dparkins: https://github.com/dparkins
29+
.. _fortran-lsp: https://atom.io/packages/fortran-lsp
30+
.. _@gnikit: https://github.com/gnikit
31+
.. _ide-fortran: https://atom.io/packages/ide-fortran
32+
.. _@hansec: https://github.com/hansec
33+
34+
Sublime Text
35+
------------
36+
37+
Firstly, install ``fortls`` then install the `LSP`_ package from package control.
38+
Finally, install the `Fortran`_ package and add the following in your configuration
39+
40+
.. code-block:: json
41+
42+
{
43+
"clients": {
44+
"fortls": {
45+
"enabled": true,
46+
"command": ["fortls", "--notify_init"],
47+
"selector": "source.modern-fortran | source.fixedform-fortran"
48+
}
49+
}
50+
}
51+
52+
For more details see the LSP `documentation`_.
53+
54+
.. _LSP: https://github.com/sublimelsp/LSP
55+
.. _Fortran: https://packagecontrol.io/packages/Fortran
56+
.. _documentation: https://lsp.sublimetext.io/language_servers/#fortran
57+
58+
59+
Vim, Neovim, GVim
60+
-----------------
61+
62+
Firstly install the plugin `LanguageClient-neovim`_. Then edit your ``~/.vimrc`` settings file
63+
to set ``fortls`` for Fortran files
64+
65+
.. code-block:: vim
66+
67+
" Required for operations modifying multiple buffers like rename. set hidden
68+
let g:LanguageClient_serverCommands = {
69+
" Add any default arguments you want fortls to have inside []
70+
\ 'fortls': ['--hover_signature', '--use_signature_help'],
71+
\ }
72+
73+
" note that if you are using Plug mapping you should not use `noremap` mappings.
74+
nmap <F5> <Plug>(lcn-menu)
75+
" Or map each action separately
76+
nmap <silent>K <Plug>(lcn-hover)
77+
nmap <silent> gd <Plug>(lcn-definition)
78+
nmap <silent> <F2> <Plug>(lcn-rename)
79+
80+
.. _LanguageClient-neovim: https://github.com/autozimu/LanguageClient-neovim
81+
82+
EMACS
83+
-----
84+
85+
Install the `lsp-mode`_ plugin. This should then allow for the variables
86+
`lsp-clients-fortls-args`_ and `lsp-clients-fortls-executable`_ to be defined in the ``~/.emacs`` configuration file.
87+
88+
.. _lsp-mode: https://emacs-lsp.github.io/lsp-mode/page/installation
89+
.. _lsp-clients-fortls-args: https://emacs-lsp.github.io/lsp-mode/page/lsp-fortran/#lsp-clients-fortls-args
90+
.. _lsp-clients-fortls-executable: https://emacs-lsp.github.io/lsp-mode/page/lsp-fortran/#lsp-clients-fortls-executable
91+
92+
Visual Studio 2017
93+
------------------
94+
95+
Installing this `VS17 extension`_ should enable ``fortls`` features in Visual Studio
96+
97+
.. _VS17 extension: https://github.com/michaelkonecny/vs-fortran-ls-client
98+

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fortls -- Fortran Language Server
1212

1313
README.md
1414
options.rst
15+
editor_integration.rst
1516
fortls_changes.md
1617
modules.rst
1718

setup.cfg

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ classifiers =
2525
Operating System :: Unix
2626
Operating System :: MacOS
2727
project_urls =
28-
Source = https://github.com/gnikit/fortls
28+
Documentation = https://gnikit.github.io/fortls
29+
Repository = https://github.com/gnikit/fortls
2930
Tracker = https://github.com/gnikit/fortls/issues
3031

3132
[options]
@@ -49,7 +50,7 @@ dev =
4950
black
5051
isort
5152
docs =
52-
sphinx ~= 4.0.0
53+
sphinx >= 4.0.0
5354
sphinx_rtd_theme
5455
sphinx-argparse
5556
sphinx-autodoc-typehints

0 commit comments

Comments
 (0)