File Header GeneratorThe File Header Generator extension aims to quickly generate readable headers for several programming languages. Additionally, it also automatically updates the last edited time. FeaturesThe File Header Generator generates headers in one, pre-determined lay-out. This layout displays a more readable type of file name, the creator of the file, when the file was created and when the file was edited most recently. Additionally, it also shows a description (see the picture below for an example).
The creation of a new header is really easy. Simply run the command: "Generate Header" from the command palette, type a discription for your file and hit enter. This description can, of course, also be added later on by editing the header manually. Note that when adding the header via the input box, it is automatically hard-wrapped to a total of 79 characters per line. 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. Custom languagesIn addition to a wide range of builtin languages, the File Header Generator also supports defining custom languages. 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. There are three comment types that must be defined for every language:
Then there is also one optional comment type:
Concretely, you can define your own comment by adding it to the map in the
As you can see, the syntax is mapping the language ID to a list with each of the definitions for the comment types. When you generate a header in such a file, you should get:
Another example where we use a custom docstring:
You can add as many custom mappings as you like.
CommandsThe File Header Generator extension current contributes the following command:
Extension SettingsThis extension contributes the following settings:
IssuesIf you encounter any issues, have suggestions or would like something to change, don't hesitate to leave an issue at our github! Please try to use the appropriate tags so I can process them more efficiently. Also note that I'm mostly making this extension for myself - that means that I might not respond to issues immediately or incorporate them, even if they're super good ideas (but I am definitely willing to listen). Release NotesSee the release notes for each version below. For a full overview, check CHANGELOG.md. 1.3.0Support for custom language definitions, as well as a few new builtin ones (WGSL and eFLINT). This release also sees a security fix. 1.2.0Added docstring-aware style for Rust and an appropriate setting for that. Also revamped backend parsing algorithm. 1.1.0Changed 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. 1.0.7Fixed a few vulnerabilities and added support for shellscript (bash etc), Makefile, Cmake and GLSL files. 1.0.6Added support for HTML, CSS and PHP languages. 1.0.4Added CUDA files support. 1.0.2Extension was now disabled whatever the setting was. Also added notification for when Generate Header is run but the extension isn't enabled. 1.0.1Added Typescript and Javascript support. 1.0.0Initial release of the extension. |