This vscode package is a fork of the GitHub project sublime_autotools. It
includes syntax highlighting for Autoconf M4 (
Automake files (e.g.,
Makefile.am). This extension uses the vscode's own
Makefile syntax support for hghlighting makefile things in automake files.
I chose to fork the sublime project in order to have
an easy way of updating vscode_autotools (which is only a matter of
In order to hack this vscode extension, first remove the extension from
inside vscode. Then:
git clone https://github.com/maelvalais/vscode_autotools.git
npm start, the
.YAML-tmLanguage files are automatically built
.JSON-tmLanguage. Whenever you change the YAML
files, it will rebuild the JSON and YAML files. Then do ⇧⌘P and
Reload Window to observe the changes on a m4/Makefile/Makefile.am file.
I chose to convert from JSON to YAML for three reasons: YAML is way less
verbose, does not need two backslashes for each backslash and has proper
comments. In order to have a proper Yaml autocompletion (I know everybody
loves the vscode's JSON autocompletion and schema helpers), I recommend to
install the Red Hat YAML extension and add the following to your settings:
The sublime fork also has a Makefile2 (an alternate grammar file for Makefiles)
but the standard vscode's Makefile support works much better (actually,
the sublime's one is kind of buggy).
- Autoconf M4 (configure.ac): fix " not being properly escaped in a string.
Note for now, that variables won't (for some reason) be highlighted in
strings. I couldn't find why.
- Automake: fix comments not being highlighted when it starts at the beginning
of a line and is interleaved with a recipe.
- Automake grammar: fixed bug with
- Makefile2: re-include it into the extension. The Automake grammar is actually
working better using makefile2.
- Many small improvements to Makefile2 and Automake, e.g.,
- Moved from JSON grammar files to YAML.
- Use vscode's default Makefile syntax grammar file instead of the sublime's
one (Makefile2). This is because Makefile2 was buggy and vscode's one works
- Automake: fix a bug with assigments followed by a comment
- added 'npm start'for rebuilding the tmLanguage files from the JSON-tmLanguage
files. You may observe some changes in grammar because of this, please tell
me if it is the case!
- Fixed the VSCode-version of Makefile that was shadowed by Makefile2, thus
making it impossible to select the VSCode-provided Makefile highlighting.
- Fixed line comments (
# instead of
- Removed block comments (block comments are not available in makefiles)
- added an icon, because we all kind of like nice icons (Twitter, CC 3.0 BY)
- Initial release. I disabled the Makefile2 part that was developped in
the upstream project (sublime_autotools) because the Makefile support of
vscode seems better (but I didn't really dig much to understand why).