Skip to content

Commit d56408c

Browse files
committed
Add config option for symbols
1 parent 7230907 commit d56408c

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
* Documentation on hover for intrisic functions
1616
* Code linting based on `gfortran` to show errors swiggles in your code
1717
* Code autocompletion (beta)
18-
* Symbols provider (just functions for now)
18+
* Symbols provider
1919

2020
![symbol_nav](./doc/symbol_nav.png)
2121

2222
## Settings
2323

2424
You can control the include paths to be used by the linter with the `fortran.includePaths` setting.
25+
2526
```
2627
{
2728
"fortran.includePaths": [
@@ -30,36 +31,71 @@ You can control the include paths to be used by the linter with the `fortran.inc
3031
]
3132
}
3233
```
34+
3335
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.gfortranExecutable` setting.
36+
3437
```
3538
{
3639
"fortran.gfortranExecutable": '/usr/local/bin/gfortran-4.7',
3740
}
3841
```
42+
3943
If you want to pass extra options to the `gfortran` executable or override the default one, you can use the setting `fortran.linterExtraArgs`. By default `-Wall` is the only option.
44+
4045
```
4146
{
4247
"fortran.linterExtraArgs": ['-Wall'],
4348
}
4449
```
4550

51+
You can configure what kind of symbols will appear in the symbol list by using
52+
53+
```
54+
{
55+
"fortran.symbols": [ "function", "subroutine"]
56+
}
57+
```
58+
59+
The available options are
60+
61+
* "function"
62+
* "subroutine"
63+
* "variable"
64+
* "module" (not supported yet)
65+
* "program" (not supported yet)
66+
67+
and by default only functions and subroutines are shown
68+
4669
## Snippets
70+
4771
This is a list of some of the snippets included, if you like to include some additionals snippets please let me know and I will add them.
72+
4873
#### Program skeleton
49-
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif )
74+
75+
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif)
76+
5077
#### Module skeleton
51-
![module snippet](https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif )
78+
79+
![module snippet](https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif)
5280

5381
## Error swiggles
82+
5483
To trigger code validations you must save the file first.
5584

5685
## Requirements
86+
5787
For the linter to work you need to have `gfortran` on your path, or wherever you configure it to be.
88+
5889
## Issues
90+
5991
Please report any issues and feature request on the github repo [here](https://github.com/krvajalmiguelangel/vscode-fortran-support/issues/new)
92+
6093
## Notice
94+
6195
The syntax highlight support was imported from [TextMate bundle](https://github.com/textmate/fortran.tmbundle)
6296

6397
The idea of using gfortran cames from this awesome [fortran plugin](https://github.com/315234/SublimeFortran) for Sublime Text.
64-
## LICENSE
98+
99+
## LICENSE
100+
65101
MIT

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@
8080
"default": ["-Wall"],
8181
"description":
8282
"Specify additional options to use when calling the gfortran compiler"
83+
},
84+
"fortran.symbols": {
85+
"type": ["array"],
86+
"items": {
87+
"type": "string"
88+
},
89+
"default": ["function", "subroutine"],
90+
"description":
91+
"Specify what kind of symbols should be shown by the symbols' provider"
8392
}
8493
}
8594
}

src/features/document-symbol-provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class FortranDocumentSymbolProvider
4545
case "variable":
4646
this.updateVariablesDefiniton(document);
4747
return this.vars;
48+
default:
49+
return [];
4850
}
4951
}
5052

0 commit comments

Comments
 (0)