Skip to content

Command Syntax Definitions

FlorianDecker edited this page Apr 12, 2017 · 2 revisions

For LHM to be able to remove existing headers, it needs to be able to find the top comment in a file. Thus you need to specify the comment syntax for every language you want to use. The default configuration of LHM already provides definitions for the following languages:

  • C#
  • C, C++
  • VB
  • ASPX
  • HTML
  • XML
  • XAML
  • CSS
  • JavaScript, Typescript
  • SQL
  • PHP
  • Python
  • F#

If you want to insert license headers in files of other languages, you need to add the comment definitions yourself. You can do this in the Tools/Options/License Header Manager/Languages menu in Visual Studio. For each language you need to specify the extension of the file type and either the symbol for line comments (such as // in C# or ' in VB) or the begin and end of multi line comments ( /* and */ in C#). Optionally you can provide the syntax for code regions as well if your language supports them and you want to use them in your license headers.

Note: You can specify more than one extension per language. This is useful if you want to insert different license headers into files of the same language depending on the actual extension. For example, you might want to insert different headers into .cs, .designer.cs and .xaml.cs files.