Skip to content

Commit 0845974

Browse files
committed
Update readme with snippets
1 parent 2e3e1ac commit 0845974

File tree

3 files changed

+61
-7
lines changed

3 files changed

+61
-7
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ This extension provides support for the Fortran programming language. It include
88
* Code Snippets
99
* Documentation on hover for intrisic functions
1010
* Code linting based on `gfortran` to show errors swiggles in your code
11+
## Snippets
12+
This are some of the snippets included
1113

14+
#### Program skeleton
15+
16+
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif )
17+
18+
#### Module skeleton
19+
![module snippet](https://media.giphy.com/media/3ohzdUNRuio5FfyF1u/giphy.gif )
1220
## Requirements
1321
For the linter to work you need to have `gfortran` on your path, or wherever you configure it to be.
1422
## Issues

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "linter-gfortran",
33
"displayName": "Modern Fortran",
44
"description": "Modern Fortran language support, including syntax highlighting and error detection.",
5-
"version": "0.4.1",
5+
"version": "0.4.2",
66
"publisher": "krvajalm",
77
"engines": {
88
"vscode": "^1.12.0"
@@ -46,11 +46,11 @@
4646
}
4747
],
4848
"snippets": [
49-
{
50-
"language": "fortran90",
51-
"path": "./snippets/fortran90.json"
52-
}
53-
]
49+
{
50+
"language": "fortran90",
51+
"path": "./snippets/fortran90.json"
52+
}
53+
]
5454
},
5555
"scripts": {
5656
"vscode:prepublish": "tsc -p ./",

snippets/fortran90.json

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"body": [
1515
"module ${1:name}",
1616
"implicit none",
17-
"",
17+
"${2}",
1818
"contains",
1919
"end module ${1:name}"
2020
],
@@ -29,6 +29,52 @@
2929
"enddo"
3030
],
3131
"description": "Create a do loop"
32+
},
33+
"Function": {
34+
"prefix": "fun",
35+
"body": [
36+
"function ${1:func}(${2:arg}) result(${3:retval})",
37+
"${4:type} :: ${2:arg}",
38+
"${4:type} :: ${3:retval}",
39+
" !TODO_add_body",
40+
" ${5}",
41+
"end function ${1:func}"
42+
],
43+
"description": "Create a function"
44+
},
45+
"Subroutine": {
46+
"prefix": "sub",
47+
"body": [
48+
"subroutine ${1:routine}(${2:arg1}, ${3: arg2})",
49+
"${4:type1},intent(in) :: ${2:arg1}",
50+
"${5:type2},intent(out) :: ${3:arg2}",
51+
" !TODO_add_body",
52+
" ${6}",
53+
"end subroutine ${1:routine}"
54+
],
55+
"description": "Create a function"
56+
},
57+
"Module documentation header": {
58+
"prefix": "modoc" ,
59+
"body": [ "!------------------------------------------------------------------------------",
60+
"! ${1:Institution}, ${2:Affiliation}",
61+
"!------------------------------------------------------------------------------",
62+
"!",
63+
"! MODULE: ${3: Module name}",
64+
"!",
65+
"!> @author",
66+
"!> ${4:Author Name}}",
67+
"!",
68+
"! DESCRIPTION: ",
69+
"!> ${5: Short module description}",
70+
"!",
71+
"! REVISION HISTORY:",
72+
"! dd Mmm yyyy - Initial Version",
73+
"! TODO_dd_mmm_yyyy - TODO_describe_appropriate_changes - TODO_name",
74+
"!------------------------------------------------------------------------------"
75+
],
76+
"description": "Add module documentation header"
3277
}
3378

79+
3480
}

0 commit comments

Comments
 (0)