Skip to content

Commit faa8138

Browse files
committed
Updates README, SECURITY and package.json
1 parent fcedc8b commit faa8138

24 files changed

+432
-109
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2929

3030
### Changed
3131

32+
- Updates `README` text and animations, changes `SECURITY` and updates `package.json`
3233
- Changes the interface of the extension to accommodate for the newest features
3334
([#292](https://github.com/krvajal/vscode-fortran-support/issues/292))
3435
- Changes main parts of the extension to being asynchronous

README.md

+120-53
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,135 @@
1-
# Modern Fortran language support for VSCode
1+
![alt](assets/modern-fortran-logo.png)
22

3-
[![GitHub Actions](https://github.com/krvajal/vscode-fortran-support/actions/workflows/main.yaml/badge.svg)](https://github.com/krvajal/vscode-fortran-support/actions)
3+
[![GitHub Actions](https://github.com/fortran-lang/vscode-fortran-support/actions/workflows/main.yaml/badge.svg)](https://github.com/fortran-lang/vscode-fortran-support/actions)
44
[![Downloads](https://vsmarketplacebadge.apphb.com/downloads-short/krvajalm.linter-gfortran.svg)](https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran)
55
[![Installs](https://vsmarketplacebadge.apphb.com/installs/krvajalm.linter-gfortran.svg)](https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran)
66
[![VS Marketplace](https://vsmarketplacebadge.apphb.com/version-short/krvajalm.linter-gfortran.svg)](https://marketplace.visualstudio.com/items?itemName=krvajalm.linter-gfortran)
77
[![MIT License](https://img.shields.io/npm/l/stack-overflow-copy-paste.svg?)](http://opensource.org/licenses/MIT)
88

9+
![alt](assets/intro-demo.gif)
10+
911
## Key Features
1012

1113
- Syntax highlighting (Free and Fixed forms)
12-
- Hover support
13-
- Autocompletion support
14-
- Peek/Go to definitions and references
15-
- Linting support i.e. error wiggles for `gfortran`, `flang` and `ifort`
16-
- Symbols outline support for functions, subroutines, modules, etc.
17-
- Native support leveraging the `fortls`
18-
- Debugger, uses Microsoft's [C/C++ extension](https://github.com/Microsoft/vscode-cpptools)
14+
- Hover support, Signature help and Auto-completion
15+
- GoTo/Peek implementation and Find/Peek references
16+
- Project-wide and Document symbol detection and Renaming
17+
- Native Language Server integration with [`fortls`](https://github.com/gnikit/fortls)
18+
- Linting support for `gfortran`, `flang` and `ifort`
19+
- Debugger [C/C++ extension](https://github.com/Microsoft/vscode-cpptools)
1920
- Formatting with [findent](https://github.com/gnikit/findent-pypi) or [fprettify](https://github.com/pseewald/fprettify)
2021
- Code snippets (more can be defined by the user [see](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets))
2122

22-
![alt](./images/intro-demo.gif)
23-
24-
## Settings
23+
## Language Server integration
2524

26-
You can control the include paths to be used by the linter with the `fortran.linter.includePaths` setting.
27-
The `linter.includePaths` should match the include requirements for your projects compilation.
25+
The Fortran Language Server [`fortls`](https://github.com/gnikit/fortls) is responsible
26+
for providing a lot of the higher level, IDE functionality. By default,
27+
`Modern Fortran` will attempt to use it for hover, autocompletion, symbols and Go to & Peeking into definitions.
2828

29-
> NOTE: if a glob pattern is used only directories matching the pattern will be included.
29+
Allow for `fortls` to be automatically installed with `pip` or `Anaconda` and
30+
if the location where `fortls` is installed is not in your `PATH` point VS Code
31+
to the `fortls` location by setting
3032

31-
```jsonc
33+
```json
3234
{
33-
"fortran.linter.includePaths": ["/usr/include/**", "${workspaceFolder}/include/**"]
35+
"fortran.fortls.path": "/custom/path/to/fortls"
3436
}
3537
```
3638

37-
By default the `gfortran` executable is assumed to be found in the path. In order to use a different one or if it can't be found in the path you can point the extension to use a custom one with the `fortran.linter.compilerPath` setting.
39+
For more about the Language Server's capabilities please refer to the
40+
[documentation](https://gnikit.github.io/fortls/) of `fortls`.
41+
42+
## Linting
43+
44+
Linting allows for compiler error and warning detection while coding
45+
without the user having to compile.
46+
47+
Using an invalid if expression
48+
49+
![alt](assets/lint-demo.gif)
50+
51+
Using incorrect type and rank as function argument
52+
53+
![alt](assets/lint-demo2.gif)
54+
55+
| :memo: Note |
56+
| ------------------------------------------ |
57+
| Save your file to generate linting results |
58+
59+
Linting results can be improved by providing additional options to the compiler.
60+
61+
### Including directories
62+
63+
You can control the include paths to be used by the linter with the `fortran.linter.includePaths` option.
64+
65+
| :exclamation: Important |
66+
| ------------------------------------------------------------------------------------------------------------------ |
67+
| For the best linting results `linter.includePaths` should match the included paths for your project's compilation. |
3868

3969
```jsonc
4070
{
41-
"fortran.linter.compilerPath": "/usr/local/bin/gfortran-11.2"
71+
"fortran.linter.includePaths": ["/usr/include/**", "${workspaceFolder}/include/**"]
4272
}
4373
```
4474

45-
If you want to pass extra options to the `gfortran` executable or override the default one, you can use the setting `fortran.linter.extraArgs`. Default value is `-Wall` (or `-warn all` for ifort).
75+
| :exclamation: Important |
76+
| -------------------------------------------------------------------------------- |
77+
| If a glob pattern is used only directories matching the pattern will be included |
78+
79+
### Additional linting options
80+
81+
More options can be passed to the linter via
4682

4783
```jsonc
4884
{
49-
"fortran.linter.extraArgs": ["-Wall"]
85+
"fortran.linter.extraArgs": [
86+
"-fdefault-real-8",
87+
"-fdefault-double-8",
88+
"-Wunused-variable",
89+
"-Wunused-dummy-argument"
90+
]
5091
}
5192
```
5293

53-
To show the symbols in the file outline enable `provide.symbols`. Symbols can be
54-
served by the fortls, the built-in, both or none. By default
55-
`fortls` is used.
94+
Default value is `-Wall` (or `-warn all` for ifort).
95+
96+
### Changing linting compiler
97+
98+
By default, the linter used is `gfortran`, Intel's `ifort` and LLVM's `flang` are also supported.
99+
One can use a different linter compiler via the option
56100

57101
```jsonc
58102
{
59-
"fortran.provide.symbols": "fortls" | "Built-in" | "Both" | "Disable"
103+
"fortran.linter.compiler": "ifort" | "gfortran" | "flang" | "Disabled"
60104
}
61105
```
62106

63-
You can also configure the case for fortran intrinsics auto-complete by using
107+
The linter executable is assumed to be found in the `PATH`.
108+
In order to use a different executable or if the executable can't be found in the `PATH`
109+
you can point the extension to another linter with the `fortran.linter.compilerPath` option.
64110

65111
```jsonc
66112
{
67-
"fortran.preferredCase": "lowercase" | "uppercase"
113+
"fortran.linter.compilerPath": "/opt/oneapi/compiler/2022.0.2/linux/bin/intel64/ifort"
68114
}
69115
```
70116

71-
## Snippets
72-
73-
This is a list of some of the snippets included, if you like to include additional snippets please let me know and I will add them.
74-
75-
### Program skeleton
76-
77-
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif)
78-
79-
#### Module skeleton
80-
81-
![module snippet](https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif)
82-
83-
## Error wiggles
84-
85-
To trigger code validations you must save the file first.
86-
87117
## Debugging
88118

119+
![alt](assets/gdb_ani.gif)
120+
89121
The extension uses the debugger from Microsoft's
90122
[C/C++ extension](https://github.com/Microsoft/vscode-cpptools)
91123
for Visual Studio Code. This allows this extension to use the full functionality
92124
of the C/C++ extension for debugging applications:
93-
(un)conditional breaking points, expression evaluation, multi-threaded debugging,
125+
(un)conditional breaking points, expression evaluation, multithreaded debugging,
94126
call stack, stepping, watch window.
95127

96128
A minimal `launch.json` script, responsible for controlling the debugger, is
97129
provided below. However, Visual Studio Code is also capable of autogenerating
98130
a `launch.json` file and the configurations inside the file.
99131

100-
More details about how to setup the debugger can be found in Microsoft's website:
132+
More details about how to set up the debugger can be found in Microsoft's website:
101133

102134
- General information about debugging in VS Code: <https://code.visualstudio.com/docs/editor/debugging>
103135
- C/C++ extension debugger information: <https://code.visualstudio.com/docs/cpp/cpp-debug>
@@ -141,22 +173,22 @@ installed with `pip` automatically through the extension.
141173

142174
| findent | fprettify |
143175
| :-------------------------------: | :---------------------------------: |
144-
| ![alt](./images/findent-demo.gif) | ![alt](./images/fprettify-demo.gif) |
176+
| ![alt](./assets/findent-demo.gif) | ![alt](./assets/fprettify-demo.gif) |
145177

146178
The formatter is controlled by the user option
147179

148180
```jsonc
149181
{
150-
"fortran.formatting.formatter": "findent" // "fprettify" or "Disabled"
182+
"fortran.formatting.formatter": "findent" | "fprettify" | "Disabled"
151183
}
152184
```
153185

154186
Additional arguments to the formatter can be input using
155187

156188
```json
157189
{
158-
"fortran.formatting.findentArgs": ["-Cn", "-Rr"],
159-
"fortran.formatting.fprettifyArgs": ["--whitespace-comma", "--enable-decl"]
190+
"fortran.formatting.findentArgs": ["-Cn", "-Rr"],
191+
"fortran.formatting.fprettifyArgs": ["--whitespace-comma", "--enable-decl"]
160192
}
161193
```
162194

@@ -168,9 +200,46 @@ If the formatter is not present in the `PATH` its location can be input with
168200
}
169201
```
170202

171-
### NOTE: About `findent`
203+
| :memo: Note |
204+
| ---------------------------------------------------------------------- |
205+
| `findent` can also be used to generate dependency files for a project. |
206+
207+
## Snippets
208+
209+
Snippets are included by both `fortls` Language Server and the Modern Fortran VS Code extension.
210+
Some available snippets can be seen below. Users can define their own snippets
211+
by following these VS Code [instructions](https://code.visualstudio.com/docs/editor/userdefinedsnippets).
212+
213+
If you think a snippet should be shipped by with the extension feel free to
214+
submit a [feature request](https://github.com/fortran-lang/vscode-fortran-support/issues/new?assignees=&labels=feature-request&template=feature_request.md&title=)
215+
216+
### Program skeleton
217+
218+
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif)
219+
220+
#### Module skeleton
221+
222+
![module snippet](https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif)
223+
224+
## Advanced options
225+
226+
To show the symbols in the file outline enable `provide.symbols`. Symbols can be
227+
served by the fortls, the built-in, both or none. By default
228+
`fortls` is used.
229+
230+
```jsonc
231+
{
232+
"fortran.provide.symbols": "fortls" | "Built-in" | "Both" | "Disable"
233+
}
234+
```
235+
236+
You can also configure the case for fortran intrinsics auto-complete by using
172237

173-
`findent` can also be used to generate dependency files for a project.
238+
```jsonc
239+
{
240+
"fortran.preferredCase": "lowercase" | "uppercase"
241+
}
242+
```
174243

175244
## All options
176245

@@ -204,8 +273,6 @@ A summary of all the options
204273

205274
## Requirements
206275

207-
For the linter to work you need to have `gfortran` on your path, or wherever you configure it to be.
208-
209276
For debugging you need to have one of the following debuggers installed:
210277

211278
- **Linux**: GDB

SECURITY.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22

33
## Supported Versions
44

5-
Use this section to tell people about which versions of your project are
6-
currently being supported with security updates.
5+
Only the latest version of the extension is actively supported. Out publisher
6+
ID in the VS Codes store changed with version `v3.0.0`, therefore older versions
7+
are no longer available for download.
78

89
| Version | Supported |
910
| ------- | ------------------ |
10-
| 5.1.x | :white_check_mark: |
11-
| 5.0.x | :x: |
12-
| 4.0.x | :white_check_mark: |
13-
| < 4.0 | :x: |
11+
| >= 3.0 | :white_check_mark: |
12+
| < 3.0 | :x: |
1413

1514
## Reporting a Vulnerability
1615

17-
Use this section to tell people how to report a vulnerability.
18-
19-
Tell them where to go, how often they can expect to get an update on a
20-
reported vulnerability, what to expect if the vulnerability is accepted or
21-
declined, etc.
16+
If a security vulnerability is found that is not already being tracked please open a
17+
[bug report](https://github.com/fortran-lang/vscode-fortran-support/issues/new?assignees=&labels=bug&template=bug_report.md&title=).

assets/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Creating High Quality GIF animations
2+
3+
Two scripts have been included inside the `tools` folder for ease of use, but the following instructions should allow for more custom-made GIFs
4+
5+
## Steps
6+
7+
1. Use a screen capturing software to record the animation
8+
2. Use `ffmpeg` to convert the animation into `.png` frames
9+
10+
> **Note:** this is also the step to add any additional editing to the original animation
11+
> like padded boarders
12+
13+
```sh
14+
ffmpeg -i animation.mp4 frame%05d.png
15+
```
16+
17+
or adding additional options like a border
18+
19+
```sh
20+
ffmpeg -i animation.mp4 -vf "pad=width=900:height=550:x=5:y=5:color=734f96" frame%05d.png
21+
```
22+
23+
3. Download [Gifski](https://gif.ski) to merge the frames into a `.gif` and run
24+
25+
> **Note:** gifski produces the most color-accurate GIFs
26+
27+
```sh
28+
gifski --width 888 -o output.gif frame*.png
29+
```
30+
31+
Alternatively to step **3.** one can use `ffmpeg`, but the final animation will be
32+
considerably less sharp and artifact-free.
33+
34+
```sh
35+
ffmpeg -i animation.mp4 -vf palettegen palette.png
36+
ffmpeg -i animation.mp4 -i palette.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
37+
```
File renamed without changes.

0 commit comments

Comments
 (0)