Advanced HOCON support for Visual Studio Code.
Spooky HOCON Toolkit brings clean, practical HOCON support to VS Code for .conf and .hocon files. It is designed for developers who want reliable syntax highlighting, useful formatting tools, lightweight validation, and a smoother editing experience for real-world configuration files.
Whether you work with backend services, Lightbend Config, application settings, or Minecraft-related configs, this extension helps make HOCON easier to read, write, and maintain.
Features
- Full language support for
.conf and .hocon
- Syntax highlighting that matches your current VS Code theme
- Support for comments with
# and //
- Highlighting for strings, triple strings, booleans, numbers,
null, substitutions, includes, arrays, objects, and operators
- Document formatting and selection formatting
- Multiple formatting modes for different workflows
- Lightweight diagnostics for common HOCON mistakes
- Ready-to-use snippets for common HOCON structures
- Helpful for production configs, service configs, and Minecraft-style config files
HOCON is flexible, but editing it comfortably in a general-purpose editor can be frustrating without proper tooling. This extension focuses on the features HOCON users actually need:
- better readability
- faster editing
- cleaner formatting
- easier validation
- less time fixing small syntax mistakes
It is built to be practical, lightweight, and useful in everyday development.
Choose the formatting style that best fits your project.
safe
A conservative mode for sensitive or production files.
Use this when you want minimal structural changes and a safer formatting pass.
standard
A balanced default for everyday editing.
This mode improves readability without making formatting too aggressive.
compact
A tighter layout that reduces vertical space while staying reasonably safe.
Useful when you want a cleaner and denser config without losing too much readability.
compactAggressive
A denser formatting style than compact.
Best for users who prefer more compact config files wherever the structure allows it.
expanded
Turns compact sections back into a more vertical, multiline layout.
Useful when reviewing dense configs or when you want easier manual editing.
Commands
Open the Command Palette in VS Code and run any of the following:
HOCON: Format Safe
HOCON: Format Standard
HOCON: Format Compact
HOCON: Format Compact Aggressive
HOCON: Format Expanded
HOCON: Validate Document
HOCON: Select Format Mode
Settings
Spooky HOCON Toolkit includes configurable options so users can adapt formatting and validation to their own workflow.
Sets the default formatting mode.
Available values:
safe — conservative formatting
standard — balanced formatting
compact — tighter structural formatting
compactAggressive — denser formatting where possible
expanded — expands compact sections into multiline blocks
Adds spaces around operators such as =, :, and +=.
Adds a space after commas during formatting.
Removes trailing whitespace from formatted lines.
Adds a space before opening braces in object declarations.
hoconPro.validate.onSave
Runs lightweight HOCON diagnostics when the file is saved.
hoconPro.validate.onType
Runs lightweight HOCON diagnostics while you type.
Typical workflow
- Open a
.conf or .hocon file in VS Code
- Run
HOCON: Select Format Mode
- Choose the formatting style you prefer
- Format the entire document or just the selected text
- Use
HOCON: Validate Document when you want to manually check the file
Who is this extension for?
Spooky HOCON Toolkit is a good fit for:
- developers using HOCON in backend or service projects
- teams working with Lightbend Config / Typesafe Config
- users maintaining application and environment configs
- Minecraft communities working with HOCON-based configuration files
- anyone who wants better HOCON support inside VS Code
Support
If you find a bug, want to request a feature, or need help using the extension, please use the support links below:
HOCON reference
This extension is based on the HOCON specification from Lightbend Config.
Development
npm install
npm run lint
npm run compile
Then press F5 in VS Code to open the Extension Development Host.
Package the extension
npx @vscode/vsce package
License
MIT
Linting
npm run lint
npm run lint:fix