You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Support for WGSL and [eFLINT](https://gitlab.com/eflint).
7
+
- A section on the definition of custom languages in the `README.md` file.
8
+
- The possibility to define your own languages using the new `file-header-generator.customLanguages` property.
6
9
7
-
- Initial release
10
+
### Changed
11
+
- The `file-header-generator.rustDocString` property to `file-header-generator.docString`.
12
+
- The order of the CHANGELOG.md file
13
+
- The dates in the CHANGELOG.md file
8
14
9
-
## [1.0.1] - 15-01-2020
15
+
### Fixed
16
+
- Security vulnerability by bumping luxon to 2.5.2.
10
17
18
+
19
+
## [1.2.0] - 2022-07-30
11
20
### Added
12
-
- TypeScript support
13
-
- JavaScript support
21
+
- New `file-header-generator.rustDocString` property that determines if Rust comments will implement the new docstring-aware description.
22
+
23
+
### Changed
24
+
- Rust to now be docstring-aware, using `//!` for the description to propagate it to Rust's auto-generated docs. This behaviour can be controlled with the `file-header-generator.rustDocString` setting.
25
+
- Rust last-edited updates to overwrite comments with the current comment style (based on the `file-header-generator.rustDocString` property).
26
+
- The internal codebase to now use a Header struct, which makes it much more clear what we're parsing and how.
14
27
15
-
## [1.0.2] - 15-01-2020
28
+
29
+
## [1.1.0] - 2021-12-21
16
30
17
31
### Added
18
-
- Now displays notification when command `Generate Header` is run but the extension isn't enabled
32
+
- Rust support
19
33
20
-
### Fixed
21
-
- Extension is now enabling itself according to the config, not always setting itself to disabled
34
+
### Changed
35
+
- The FileHeaderGenerator can now use custom dateformats, which can be edited by the 'dateFormat' option.
36
+
- Changed the default number of lines to search from 20 to 15.
37
+
- The extension now starts up after Visual Studio Code does, increasing startup performance.
22
38
23
-
## [1.0.3] - 15-01-2020
39
+
### Fixed
40
+
- The automatic update not working on Windows due to carriage returns (`\r`).
24
41
25
-
### Added
26
-
- The changelog file is now maintained
27
42
28
-
## [1.0.4] - 23-01-2020
43
+
## [1.0.7] - 2021-05-01
29
44
30
45
### Added
31
-
- CUDA (.cu) support
46
+
- Shellscript support
47
+
- Makefile support
48
+
- CMake support
49
+
- GLSL support
32
50
33
-
## [1.0.5] - 23-01-2020
51
+
### Fixed
52
+
- A few vulnerabilities in dependencies, by upgrading to newer dependencies.
34
53
35
-
### Added
36
-
- Updated the changelog and README to include version 1.0.4 and 1.0.5.
37
54
38
-
## [1.0.6] - 16-03-2020
55
+
## [1.0.6] - 2020-03-16
39
56
40
57
### Added
41
58
- HTML support
@@ -45,35 +62,40 @@
45
62
### Changed
46
63
- Altered placeholder for file description to be a little more accurate
47
64
48
-
## [1.0.7] - 01-05-2021
65
+
66
+
## [1.0.5] - 2020-01-23
49
67
50
68
### Added
51
-
- Shellscript support
52
-
- Makefile support
53
-
- CMake support
54
-
- GLSL support
69
+
- Updated the changelog and README to include version 1.0.4 and 1.0.5.
55
70
56
-
### Fixed
57
-
- A few vulnerabilities in dependencies, by upgrading to newer dependencies.
58
71
59
-
## [1.1.0] - 21-12-2021
72
+
## [1.0.4] - 2020-01-23
60
73
61
74
### Added
62
-
- Rust support
75
+
- CUDA (.cu) support
63
76
64
-
### Changed
65
-
- The FileHeaderGenerator can now use custom dateformats, which can be edited by the 'dateFormat' option.
66
-
- Changed the default number of lines to search from 20 to 15.
67
-
- The extension now starts up after Visual Studio Code does, increasing startup performance.
77
+
78
+
## [1.0.3] - 2020-01-15
79
+
80
+
### Added
81
+
- The changelog file is now maintained
82
+
83
+
84
+
## [1.0.2] - 2020-01-15
85
+
86
+
### Added
87
+
- Now displays notification when command `Generate Header` is run but the extension isn't enabled
68
88
69
89
### Fixed
70
-
- The automatic update not working on Windows due to carriage returns (`\r`).
90
+
- Extension is now enabling itself according to the config, not always setting itself to disabled
91
+
92
+
93
+
## [1.0.1] - 2020-01-15
71
94
72
-
## [1.2.0] - 30-07-2022
73
95
### Added
74
-
- New `file-header-generator.rustDocString` property that determines if Rust comments will implement the new docstring-aware description.
96
+
- TypeScript support
97
+
- JavaScript support
75
98
76
-
### Changed
77
-
- Rust to now be docstring-aware, using `//!` for the description to propagate it to Rust's auto-generated docs. This behaviour can be controlled with the `file-header-generator.rustDocString` setting.
78
-
- Rust last-edited updates to overwrite comments with the current comment style (based on the `file-header-generator.rustDocString` property).
79
-
- The internal codebase to now use a Header struct, which makes it much more clear what we're parsing and how.
Copy file name to clipboardExpand all lines: README.md
+74-15Lines changed: 74 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,60 @@ The creation of a new header is really easy. Simply run the command: "Generate H
15
15
When the header is generated, it is automatically maintained (i.e., the 'Last Edited' date is updated) every time the file is saved. To stop this behaviour, set 'Auto updated?' to no or remove it altogether.
16
16
17
17
18
+
### Custom languages
19
+
In addition to a wide range of builtin languages, the File Header Generator also supports defining custom languages.
20
+
21
+
A language is defined in terms of a _comment set_, which is either a triplet or quadruplet of "comments" (though they can be any string) that are written before each line of the header.
22
+
23
+
There are three comment types that must be defined for every language:
24
+
- The first comment in the set is the _start comment_, i.e., the prefix printed before the first line.
25
+
- The second comment in the set is the _middle comment_, i.e., the prefix printed for lines not covered by the other comment types.
26
+
- The third comment in the set is the _end comment_, i.e., the prefix printed for the last line.
27
+
28
+
Then there is also one optional comment type:
29
+
- The fourth comment in the set is the _doc comment_, which is printed before lines part of the description. This distinction allows some languages to extract semantic information from the header (e.g., Rust).
30
+
31
+
Concretely, you can define your own comment by adding it to the map in the `file-header-generator.customLanguages` setting. For example, you can set the following in your [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings) for a Plain Text (`plaintext`) file:
32
+
33
+
```json
34
+
{
35
+
"file-header-generator.customLanguages": {
36
+
"plaintext": [ "!0", "!1", "!2" ],
37
+
}
38
+
}
39
+
```
40
+
As you can see, the syntax is mapping the language ID to a list with each of the definitions for the comment types.
41
+
42
+
When you generate a header in such a file, you should get:
43
+
44
+

45
+
_An example header generated with our custom definition, which shows where each comment type is printed._
46
+
47
+
Another example where we use a custom docstring:
48
+
```json
49
+
{
50
+
"file-header-generator.customLanguages": {
51
+
"plaintext": [ "!0", "!1", "!2", "!d" ],
52
+
}
53
+
}
54
+
```
55
+
56
+

57
+
_An example header generated with our custom definition that also shows a doc comment._
58
+
59
+
You can add as many custom mappings as you like.
60
+
61
+
> Tip! You can discover the language ID by opening up the language menu and checking the brackets after every language. That shows its ID.
62
+
>
63
+
> The button can be found in the bottom-right, usually with the name of the language of your current file:
64
+
>
65
+
> 
66
+
>
67
+
> Clicking it reveals a menu that looks like the following:
68
+
>
69
+
> 
70
+
71
+
18
72
## Commands
19
73
20
74
The File Header Generator extension current contributes the following command:
@@ -32,7 +86,8 @@ This extension contributes the following settings:
32
86
*`file-header-generator.dateFormat`: The format of dates written by the FileHeaderGenerator. Is set to the current locale by default (see the list of special tokens below). For an overview of the tokens available, refer to [https://moment.github.io/luxon/#/formatting?id=table-of-tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens.). Additionally, there are a few extra values:
33
87
*`<locale>`: Formats according to the standard locale, as reported by the system. Can also use the `FFF` format for this.
34
88
*`<iso>`: Formats according to the standard ISO format.
35
-
*`file-header-generator.rustDocString`: Whether or not to use new comments for the Rust language to work better with Rust's build-in docstrings. Note that enabling this will automatically overwrite old style comments on save (and vice versa).
89
+
*`file-header-generator.customLanguages`: Defines support for custom languages. Map the language ID to a triplet of a start, middle and end comment, and optionally a docstring. See [its own section](#custom-langauges) for more information.
90
+
*`file-header-generator.docString`: Whether or not to use special doc-comments for the description part. For example, Rust has `//!`, which makes the language server aware of the description for the module. Note that enabling this will automatically overwrite old style comments on save (and vice versa).
36
91
37
92
38
93
## Issues
@@ -46,34 +101,38 @@ Also note that I'm mostly making this extension for myself - that means that I m
46
101
47
102
See the release notes for each version below. For a full overview, check CHANGELOG.md.
48
103
49
-
### 1.0.0
104
+
### 1.3.0
50
105
51
-
Initial release of the extension.
106
+
Support for custom language definitions, as well as a few new builtin ones (WGSL and [eFLINT](https://gitlab.com/eflint)). This release also sees a security fix.
52
107
53
-
### 1.0.1
108
+
### 1.2.0
54
109
55
-
Added Typescript and Javascript support.
110
+
Added docstring-aware style for Rust and an appropriate setting for that. Also revamped backend parsing algorithm.
56
111
57
-
### 1.0.2
112
+
### 1.1.0
58
113
59
-
Extension was now disabled whatever the setting was. Also added notification for when Generate Header is run but the extension isn't enabled.
114
+
Changed the date formatting from local to custom, and added support for Rust files. Also fixed the bug where the auto-update wouldn't work on Windows.
60
115
61
-
### 1.0.4
116
+
### 1.0.7
62
117
63
-
Added CUDA files support.
118
+
Fixed a few vulnerabilities and added support for shellscript (bash etc), Makefile, Cmake and GLSL files.
64
119
65
120
### 1.0.6
66
121
67
122
Added support for HTML, CSS and PHP languages.
68
123
69
-
### 1.0.7
124
+
### 1.0.4
70
125
71
-
Fixed a few vulnerabilities and added support for shellscript (bash etc), Makefile, Cmake and GLSL files.
126
+
Added CUDA files support.
72
127
73
-
### 1.1.0
128
+
### 1.0.2
74
129
75
-
Changed the date formatting from local to custom, and added support for Rust files. Also fixed the bug where the auto-update wouldn't work on Windows.
130
+
Extension was now disabled whatever the setting was. Also added notification for when Generate Header is run but the extension isn't enabled.
76
131
77
-
### 1.2.0
132
+
### 1.0.1
78
133
79
-
Added docstring-aware style for Rust and an appropriate setting for that. Also revamped backend parsing algorithm.
0 commit comments