Skip to content

Commit d1d4aff

Browse files
committed
+ add indentation rules
1 parent 0a2ba62 commit d1d4aff

File tree

3 files changed

+170
-155
lines changed

3 files changed

+170
-155
lines changed

language-configuration.json

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
11
{
2-
"comments": {
3-
"lineComment": "!"
4-
},
5-
"brackets": [
6-
["[", "]"],
7-
["(", ")"],
8-
["(/", "/)"]
9-
],
10-
"autoClosingPairs": [
11-
{ "open": "[", "close": "]" },
12-
{ "open": "(", "close": ")" },
13-
{ "open": "(/", "close": "/)" }
14-
],
15-
"surroundingPairs": [
16-
["[", "]"],
17-
["(", ")"],
18-
["'", "'"],
19-
["\"", "\""]
20-
]
2+
"comments": {
3+
"lineComment": "!"
4+
},
5+
"brackets": [
6+
[
7+
"[",
8+
"]"
9+
],
10+
[
11+
"(",
12+
")"
13+
],
14+
[
15+
"(/",
16+
"/)"
17+
]
18+
],
19+
"autoClosingPairs": [
20+
{
21+
"open": "[",
22+
"close": "]"
23+
},
24+
{
25+
"open": "(",
26+
"close": ")"
27+
},
28+
{
29+
"open": "(/",
30+
"close": "/)"
31+
}
32+
],
33+
"surroundingPairs": [
34+
[
35+
"[",
36+
"]"
37+
],
38+
[
39+
"(",
40+
")"
41+
],
42+
[
43+
"'",
44+
"'"
45+
],
46+
[
47+
"\"",
48+
"\""
49+
]
50+
],
51+
"indentationRules": {
52+
"increaseIndentPattern": "^[^!]*then\\s*(!.*)?$|^\\s*(program|subroutine|function|module|do|block|associate)\\b.*$|^\\s*(else|else\\s*if|elsewhere)\\b.*$",
53+
"decreaseIndentPattern": "^\\s*end\\s*(if|do)\\s*|^\\s*else\\b.*$|^\\s*end\\s(function|subroutine|module|program)"
54+
}
2155
}

package.json

Lines changed: 104 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,110 @@
11
{
2-
"name": "linter-gfortran",
3-
"displayName": "Modern Fortran",
4-
"description": "Modern Fortran language support, including syntax highlighting and error detection.",
5-
"version": "0.6.0",
6-
"publisher": "krvajalm",
7-
"engines": {
8-
"vscode": "^1.10.0"
9-
},
10-
"icon": "images/icon.png",
11-
"repository": {
12-
"type": "git",
13-
"url": "https://github.com/krvajalmiguelangel/vscode-fortran-support.git"
14-
},
15-
"categories": [
16-
"Languages",
17-
"Snippets",
18-
"Linters"
2+
"name": "linter-gfortran",
3+
"displayName": "Modern Fortran",
4+
"description":
5+
"Modern Fortran language support, including syntax highlighting and error detection.",
6+
"version": "0.6.1",
7+
"publisher": "krvajalm",
8+
"engines": {
9+
"vscode": "^1.10.0"
10+
},
11+
"icon": "images/icon.png",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/krvajalmiguelangel/vscode-fortran-support.git"
15+
},
16+
"categories": ["Languages", "Snippets", "Linters"],
17+
"activationEvents": ["onLanguage:fortran90"],
18+
"main": "./out/src/extension",
19+
"contributes": {
20+
"languages": [
21+
{
22+
"id": "fortran90",
23+
"aliases": ["Fortran90", "fortran90"],
24+
"extensions": [".f90", ".F90", ".f95", ".F95", ".f08", ".F08"],
25+
"configuration": "./language-configuration.json"
26+
},
27+
{
28+
"id": "fortran",
29+
"aliases": ["Fortran ", "fortran"],
30+
"extensions": [".f", ".F", ".f77", ".F77", ".FPP"]
31+
}
1932
],
20-
"activationEvents": [
21-
"onLanguage:fortran90"
33+
"grammars": [
34+
{
35+
"language": "fortran90",
36+
"scopeName": "source.fortran.modern",
37+
"path": "./syntaxes/fortran90.tmLanguage"
38+
},
39+
{
40+
"language": "fortran",
41+
"scopeName": "source.fortran",
42+
"path": "./syntaxes/fortran.tmLanguage"
43+
}
2244
],
23-
"main": "./out/src/extension",
24-
"contributes": {
25-
"languages": [
26-
{
27-
"id": "fortran90",
28-
"aliases": [
29-
"Fortran90",
30-
"fortran90"
31-
],
32-
"extensions": [
33-
".f90",
34-
".F90",
35-
".f95",
36-
".F95"
37-
],
38-
"configuration": "./language-configuration.json"
39-
},
40-
{
41-
"id": "fortran",
42-
"aliases": [
43-
"Fortran ",
44-
"fortran"
45-
],
46-
"extensions": [
47-
".f",
48-
".F",
49-
".f77",
50-
".F77",
51-
".FPP"
52-
]
53-
}
54-
],
55-
"grammars": [
56-
{
57-
"language": "fortran90",
58-
"scopeName": "source.fortran.modern",
59-
"path": "./syntaxes/fortran90.tmLanguage"
60-
},
61-
{
62-
"language": "fortran",
63-
"scopeName": "source.fortran",
64-
"path": "./syntaxes/fortran.tmLanguage"
65-
}
66-
],
67-
"snippets": [
68-
{
69-
"language": "fortran90",
70-
"path": "./snippets/fortran90.json"
71-
}
72-
],
73-
"configuration": {
74-
"type": "object",
75-
"title": "Fortran configuration",
76-
"properties": {
77-
"fortran.includePaths": {
78-
"type": [
79-
"array"
80-
],
81-
"items": {
82-
"type": "string"
83-
},
84-
"default": [],
85-
"description": "Specifies folder paths to be used as include path for the Fortran linter"
86-
},
87-
"fortran.gfortranExecutable": {
88-
"type": "string",
89-
"default": "gfortran",
90-
"description": "Specifies the complete path of the gfortran executable"
91-
},
92-
"fortran.linterEnabled": {
93-
"type": "boolean",
94-
"default": true,
95-
"description": "Enables or disables the linter functionality"
96-
},
97-
"fortran.linterExtraArgs": {
98-
"type": [
99-
"array"
100-
],
101-
"items": {
102-
"type": "string"
103-
},
104-
"default": [
105-
"-Wall"
106-
],
107-
"description": "Specify additional options to use when calling the gfortran compiler"
108-
}
109-
}
45+
"snippets": [
46+
{
47+
"language": "fortran90",
48+
"path": "./snippets/fortran90.json"
49+
}
50+
],
51+
"configuration": {
52+
"type": "object",
53+
"title": "Fortran configuration",
54+
"properties": {
55+
"fortran.includePaths": {
56+
"type": ["array"],
57+
"items": {
58+
"type": "string"
59+
},
60+
"default": [],
61+
"description":
62+
"Specifies folder paths to be used as include path for the Fortran linter"
63+
},
64+
"fortran.gfortranExecutable": {
65+
"type": "string",
66+
"default": "gfortran",
67+
"description":
68+
"Specifies the complete path of the gfortran executable"
69+
},
70+
"fortran.linterEnabled": {
71+
"type": "boolean",
72+
"default": true,
73+
"description": "Enables or disables the linter functionality"
74+
},
75+
"fortran.linterExtraArgs": {
76+
"type": ["array"],
77+
"items": {
78+
"type": "string"
79+
},
80+
"default": ["-Wall"],
81+
"description":
82+
"Specify additional options to use when calling the gfortran compiler"
11083
}
111-
},
112-
"scripts": {
113-
"vscode:prepublish": "tsc -p ./",
114-
"compile": "tsc -watch -p ./",
115-
"postinstall": "node ./node_modules/vscode/bin/install",
116-
"test": "node ./node_modules/vscode/bin/test",
117-
"lint": "node ./node_modules/tslint/bin/tslint ./src/*.ts ./src/debugAdapter/*.ts ./test/*.ts"
118-
},
119-
"devDependencies": {
120-
"@types/glob": "^5.0.30",
121-
"@types/fs-extra": "0.0.35",
122-
"fs-extra": "^1.0.0",
123-
"typescript": "^2.0.3",
124-
"vscode": "^1.0.3",
125-
"mocha": "^2.3.3",
126-
"decache": "^4.1.0",
127-
"@types/node": "^6.0.40",
128-
"@types/mocha": "^2.2.32",
129-
"glob": "^7.1.1",
130-
"istanbul": "^0.4.5",
131-
"remap-istanbul": "^0.8.4",
132-
"tslint": "^4.0.2"
84+
}
13385
}
86+
},
87+
"scripts": {
88+
"vscode:prepublish": "tsc -p ./",
89+
"compile": "tsc -watch -p ./",
90+
"postinstall": "node ./node_modules/vscode/bin/install",
91+
"test": "node ./node_modules/vscode/bin/test",
92+
"lint":
93+
"node ./node_modules/tslint/bin/tslint ./src/*.ts ./src/debugAdapter/*.ts ./test/*.ts"
94+
},
95+
"devDependencies": {
96+
"@types/glob": "^5.0.30",
97+
"@types/fs-extra": "0.0.35",
98+
"fs-extra": "^1.0.0",
99+
"typescript": "^2.0.3",
100+
"vscode": "^1.0.3",
101+
"mocha": "^2.3.3",
102+
"decache": "^4.1.0",
103+
"@types/node": "^6.0.40",
104+
"@types/mocha": "^2.2.32",
105+
"glob": "^7.1.1",
106+
"istanbul": "^0.4.5",
107+
"remap-istanbul": "^0.8.4",
108+
"tslint": "^4.0.2"
109+
}
134110
}

vsc-extension-quickstart.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
# Welcome to your first VS Code Extension
22

33
## What's in the folder
4+
45
* This folder contains all of the files necessary for your extension
56
* `package.json` - this is the manifest file in which you declare your extension and command.
6-
The sample plugin registers a command and defines its title and command name. With this information
7-
VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
7+
The sample plugin registers a command and defines its title and command name. With this information
8+
VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
89
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
9-
The file exports one function, `activate`, which is called the very first time your extension is
10-
activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
11-
We pass the function containing the implementation of the command as the second parameter to
12-
`registerCommand`.
10+
The file exports one function, `activate`, which is called the very first time your extension is
11+
activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
12+
We pass the function containing the implementation of the command as the second parameter to
13+
`registerCommand`.
1314

1415
## Get up and running straight away
16+
1517
* press `F5` to open a new window with your extension loaded
1618
* run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`
1719
* set breakpoints in your code inside `src/extension.ts` to debug your extension
1820
* find output from your extension in the debug console
1921

2022
## Make changes
23+
2124
* you can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`
2225
* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
2326

2427
## Explore the API
28+
2529
* you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`
2630

2731
## Run tests
32+
2833
* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`
2934
* press `F5` to run the tests in a new window with your extension loaded
3035
* see the output of the test result in the debug console
3136
* make changes to `test/extension.test.ts` or create new test files inside the `test` folder
32-
* by convention, the test runner will only consider files matching the name pattern `**.test.ts`
33-
* you can create folders inside the `test` folder to structure your tests any way you want
37+
* by convention, the test runner will only consider files matching the name pattern `**.test.ts`
38+
* you can create folders inside the `test` folder to structure your tests any way you wants

0 commit comments

Comments
 (0)