Skip to content

Commit 881addd

Browse files
committed
Updates README
1 parent 92e1809 commit 881addd

File tree

3 files changed

+55
-44
lines changed

3 files changed

+55
-44
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
# CHANGELONG
22

3-
### 1.13.0
3+
## 1.14.0
44

55
### Fixes
66

77
* Fixes (partially) Fortran literal variable hover
88
([#188](https://github.com/hansec/fortran-language-server/issues/188))
99

10+
## 1.13.0
11+
12+
### Improvements
13+
14+
* Adds Python glob support for `excl_paths`, `source_dirs`, `include_dirs`
15+
1016
## 1.12.1
1117

1218
### Fixes

README.md

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
A Fortran implementation of the [Language Server
1212
Protocol](https://github.com/Microsoft/language-server-protocol) using
13-
Python (2.7+ or 3.0+).
13+
Python (3.6+).
1414

1515
Editor extensions using this language server to provide autocomplete and
1616
other IDE-like functionality are available for
@@ -56,16 +56,9 @@ and [Emacs](https://github.com/emacs-lsp/lsp-mode).
5656

5757
## Installation
5858

59-
`pip install fortran-language-server`
60-
61-
If you get the following error:
62-
63-
> `'install_requires' must be a string or list of strings containing valid project/version requirement specifiers`
64-
65-
try updating setuptools:
66-
67-
pip install -U setuptools
68-
pip install fortran-language-server
59+
```sh
60+
pip install fortls
61+
```
6962

7063
## Language server settings
7164

@@ -157,36 +150,47 @@ Project specific settings can be specified by placing a JSON file named
157150
- `max_comment_line_length` Maximum comment line length (default:
158151
none)
159152

160-
### Setup source file search paths
153+
## Additional settings
154+
155+
### Default file extensions
161156

162157
By default all files with the suffix `F,F77,F90,F95,F03,F08,FOR,FPP`
163158
(case-insensitive) in the `root_dir` directory, specified during
164159
initialization, and all its sub-directories are parsed and included in
165160
the project.
166161

162+
### Excluding folders and file extensions
163+
167164
Directories and files can be excluded from the project by specifying
168-
their paths (relative to `root_dir`) in the `excl_paths` variable in the
169-
`.fortls` file. Excluded directories also exclude all sub-directories.
165+
their paths in the `excl_paths` variable in the`.fortls` file.
166+
Paths can be absolute or relative to `root_dir`.
167+
168+
Excluded directories **will not** exclude all sub-directories.
170169
Source files with a common suffix may also be excluded using the
171170
`excl_suffixes` variable.
172171

172+
> NOTE: All directory inputs fields (`excl_paths`, `source_dirs`, `include_dirs`) support
173+
> [Python glob patterns](https://docs.python.org/3/library/glob.html) e.g. `/**`, `*`, etc.
174+
175+
### Including source directories
176+
177+
By default all source directories under `root_dir` are recursively included.
173178
Source file directories can also be specified manually by specifying
174-
their paths (relative to `root_dir`) in the `source_dirs` variable in
175-
the `.fortls` file. When `source_dirs` is specified directories are not
176-
added recursively, so any nested sub directories must be explicitly
177-
listed. However, `root_dir` does not need to be specified manually as it
178-
is always included.
179-
180-
External source files (ex. libraries) can also be included in language
181-
server results by specifying their paths in the `ext_source_dirs`
182-
variable in the `.fortls` file. These files will be parsed during
183-
initialization, but will not be updated with any changes made until the
184-
language server is restarted. As with `source_dirs`, specified
185-
directories are not added recursively, so any nested sub directories
186-
must be explicitly listed.
187-
188-
**Note:** The previous naming convention for source file directories
189-
(`mod_dirs`) is still supported but has been deprecated.
179+
their paths in the `source_dirs` variable in `.fortls`.
180+
Paths can be absolute or relative to `root_dir`.
181+
the `.fortls` file.
182+
183+
When defining `source_dirs` in `.fortls` the default behaviour (i.e. including
184+
all files in all subdirectories under `root_dir`) is overriden. To include them
185+
back again one can do
186+
187+
```json
188+
{
189+
"source_dirs": ["/**", "all", "other", "dirs"]
190+
}
191+
```
192+
193+
> NOTE: `root_dir` does not need to be specified manually as it is always included.
190194
191195
### Preprocessing
192196

@@ -205,7 +209,7 @@ File suffixes for preprocessing can be controlled with the variable
205209
used _only_ those files with the specified suffixes will be
206210
preprocessed. If an empty array is specified then _no_ preprocessing
207211
will be performed on any files. By default, or if the variable is
208-
ommited or `null`, only files with upper case suffixes are preprocessed.
212+
omitted or `null`, only files with upper case suffixes are preprocessed.
209213

210214
Preprocessor definitions can be set for each project, to improve support
211215
for Fortran files using conditional compilation, using the `pp_defs`
@@ -226,17 +230,18 @@ File search is performed starting with the containing directory followed
226230
by the specified `include_dirs` specified paths, in order (left to
227231
right).
228232

229-
{
230-
"source_dirs": ["subdir1", "subdir2"],
231-
"excl_paths": ["subdir3", "subdir1/file_to_skip.F90"],
232-
"excl_suffixes": ["_skip.f90"],
233-
"pp_suffixes": [".f03", ".F90"],
234-
"pp_defs": {"HAVE_PACKAGE": ""},
235-
"include_dirs": ["rel_include/dir_path", "/abs/include/dir/path"],
236-
"ext_source_dirs": ["/path/to/fortran/library"],
237-
"lowercase_intrinsics": false,
238-
"debug_log": false
239-
}
233+
```json
234+
{
235+
"source_dirs": ["subdir1/**", "subdir2"],
236+
"excl_paths": ["subdir3/**", "subdir1/file_to_skip.F90"],
237+
"excl_suffixes": ["_skip.f90"],
238+
"pp_suffixes": [".f03", ".F90"],
239+
"pp_defs": { "HAVE_PACKAGE": "" },
240+
"include_dirs": ["rel_include/dir_path", "/abs/include/dir/path"],
241+
"lowercase_intrinsics": false,
242+
"debug_log": false
243+
}
244+
```
240245

241246
## Bug reports
242247

fortls/parse_fortran.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169

170170
def expand_name(line, char_poss):
171171
"""Get full word containing given cursor position"""
172-
# The order here is important.
172+
# The order here is important.
173173
# WORD will capture substrings in logical and strings
174174
regexs = [LOGICAL_REGEX, SQ_STRING_REGEX, DQ_STRING_REGEX, WORD_REGEX, NUMBER_REGEX]
175175
for r in regexs:

0 commit comments

Comments
 (0)