Skip to content

Commit f225754

Browse files
committed
Implemented 1.3.0
1 parent 005773e commit f225754

File tree

11 files changed

+1630
-144
lines changed

11 files changed

+1630
-144
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
out/*
22
node_modules/*
3+
package-lock.json

CHANGELOG.md

Lines changed: 61 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,58 @@
11
# Change Log
22

3-
## [Unreleased]
43

5-
## [1.0.0] - 15-01-2020
4+
## [1.3.0] - 2023-01-21
5+
### Added
6+
- 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.
69

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
814

9-
## [1.0.1] - 15-01-2020
15+
### Fixed
16+
- Security vulnerability by bumping luxon to 2.5.2.
1017

18+
19+
## [1.2.0] - 2022-07-30
1120
### 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.
1427

15-
## [1.0.2] - 15-01-2020
28+
29+
## [1.1.0] - 2021-12-21
1630

1731
### Added
18-
- Now displays notification when command `Generate Header` is run but the extension isn't enabled
32+
- Rust support
1933

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.
2238

23-
## [1.0.3] - 15-01-2020
39+
### Fixed
40+
- The automatic update not working on Windows due to carriage returns (`\r`).
2441

25-
### Added
26-
- The changelog file is now maintained
2742

28-
## [1.0.4] - 23-01-2020
43+
## [1.0.7] - 2021-05-01
2944

3045
### Added
31-
- CUDA (.cu) support
46+
- Shellscript support
47+
- Makefile support
48+
- CMake support
49+
- GLSL support
3250

33-
## [1.0.5] - 23-01-2020
51+
### Fixed
52+
- A few vulnerabilities in dependencies, by upgrading to newer dependencies.
3453

35-
### Added
36-
- Updated the changelog and README to include version 1.0.4 and 1.0.5.
3754

38-
## [1.0.6] - 16-03-2020
55+
## [1.0.6] - 2020-03-16
3956

4057
### Added
4158
- HTML support
@@ -45,35 +62,40 @@
4562
### Changed
4663
- Altered placeholder for file description to be a little more accurate
4764

48-
## [1.0.7] - 01-05-2021
65+
66+
## [1.0.5] - 2020-01-23
4967

5068
### 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.
5570

56-
### Fixed
57-
- A few vulnerabilities in dependencies, by upgrading to newer dependencies.
5871

59-
## [1.1.0] - 21-12-2021
72+
## [1.0.4] - 2020-01-23
6073

6174
### Added
62-
- Rust support
75+
- CUDA (.cu) support
6376

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
6888

6989
### 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
7194

72-
## [1.2.0] - 30-07-2022
7395
### 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
7598

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.
99+
100+
## [1.0.0] - 2020-01-15
101+
Initial release.

README.md

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,60 @@ The creation of a new header is really easy. Simply run the command: "Generate H
1515
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.
1616

1717

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+
![Example header with custom comments](images/plaintext-header-1.png)
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+
![Example header with custom comments, including a docstring one](images/plaintext-header-2.png)
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+
> ![Shows the button to spawn the language menu](images/language-menu-button.png)
66+
>
67+
> Clicking it reveals a menu that looks like the following:
68+
>
69+
> ![Shows an example view on the language menu, with the language IDs in brackets](images/language-menu.png)
70+
71+
1872
## Commands
1973

2074
The File Header Generator extension current contributes the following command:
@@ -32,7 +86,8 @@ This extension contributes the following settings:
3286
* `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:
3387
* `<locale>`: Formats according to the standard locale, as reported by the system. Can also use the `FFF` format for this.
3488
* `<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).
3691

3792

3893
## Issues
@@ -46,34 +101,38 @@ Also note that I'm mostly making this extension for myself - that means that I m
46101

47102
See the release notes for each version below. For a full overview, check CHANGELOG.md.
48103

49-
### 1.0.0
104+
### 1.3.0
50105

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.
52107

53-
### 1.0.1
108+
### 1.2.0
54109

55-
Added Typescript and Javascript support.
110+
Added docstring-aware style for Rust and an appropriate setting for that. Also revamped backend parsing algorithm.
56111

57-
### 1.0.2
112+
### 1.1.0
58113

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.
60115

61-
### 1.0.4
116+
### 1.0.7
62117

63-
Added CUDA files support.
118+
Fixed a few vulnerabilities and added support for shellscript (bash etc), Makefile, Cmake and GLSL files.
64119

65120
### 1.0.6
66121

67122
Added support for HTML, CSS and PHP languages.
68123

69-
### 1.0.7
124+
### 1.0.4
70125

71-
Fixed a few vulnerabilities and added support for shellscript (bash etc), Makefile, Cmake and GLSL files.
126+
Added CUDA files support.
72127

73-
### 1.1.0
128+
### 1.0.2
74129

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.
76131

77-
### 1.2.0
132+
### 1.0.1
78133

79-
Added docstring-aware style for Rust and an appropriate setting for that. Also revamped backend parsing algorithm.
134+
Added Typescript and Javascript support.
135+
136+
### 1.0.0
137+
138+
Initial release of the extension.

file-header-generator-1.3.0.vsix

459 KB
Binary file not shown.

images/language-menu-button.png

6.95 KB
Loading

images/language-menu.png

26.1 KB
Loading

images/plaintext-header-1.png

12.7 KB
Loading

images/plaintext-header-2.png

13.6 KB
Loading

0 commit comments

Comments
 (0)