Introduction
HOCON Colorizer is a VSCode Extension for HOCON, which is frequently used in Sponge.
VSCode (https://code.visualstudio.com/) is a powerful text editor developed by Microsoft.
Download Link
This extension is available on the official website: HOCON Colorizer - Visual Studio Marketplace.
You can also search HOCON
or HOCON Colorizer
in the extension tab to install it by VSCode itself.
Features
HOCON Colorizer now supports:
- Primitive values such as nulls, booleans, numbers, time units, etc.
- Strings (including quoted, unquoted, and multi-line strings)
- Comments starting with a hash (
#
) or two slashes (//
) - Objects (
{ key1: value1, key2: value2, ... }
) - Lists (
[value1, value2, value3, value4, ...]
) - Value concatenations for strings, lists, and objects
- Path expressions (like
key1.key2.key3
) - Substitutions (
${path}
, or${?path}
) - Inclusions (
include "file.conf"
)
HOCON Colorizer now provides:
- Syntax highlighting
- Folding based on indentation
- Code parsing through a built-in parser
- Code formatting by pressing
Ctrl+Shift+I
Future Plans
The features which HOCON Colorizer plans to be implemented in the future:
- Locating the definition referred to by substitution (similar to
Find Usages
in IDEs) -
Support for inclusions (likesupported sinceinclude 'file.conf'
)v0.2.1
-
Error message with more readabilitysupported sincev0.2.2
-
Code formattingsupported sincev0.2.3
… and all the valuable suggestions in the replies below.
Source Code and License
HOCON Colorizer is open source (ustc-zzzz/hocon-colorizer), and is mostly written in Scala (compiled to JavaScript by Scala.js). The source code is under MIT License, which is based on a Scala library named fastparse (lihaoyi/fastparse, also licensed under MIT).