Skip to content

BlueGlassBlock/better-json5

Repository files navigation

better-json5

JSON5 support for Visual Studio Code, done right ⚡

Syntax highlighting, validation, formatting, and JSON schema based intellisense / completion for JSON5 files in Visual Studio Code.

Features

Syntax highlighting with correctly colored keys, with your favorite theme support out-of-the-box

Syntax Highlighting

JSON Schema based validation and intellisense

Overview

Completely configurable formatting

Formatting

Sorting Command

Sorting

Proper folding for objects, arrays and multiline strings

Folding

Extension Settings

  • json5.schemas: Associate schemas to JSON5 files in the current project.
  • json5.validate.enable: Enable/disable validation.
  • json5.format.enable: Enable/disable formatting.
  • json5.format.keepLines: Keep all existing new lines when formatting.
  • json5.format.trailingCommas: Control the occurrence of trailing commas in objects and arrays.
  • json5.format.keyQuotes: Control the usage of quotes for object keys.
  • json5.format.stringQuotes: Control the usage of quotes for string values in objects and arrays.
  • json5.format.tabSize: Override the tab size for formatting. If set to false, it will use the default tab size of the editor. If set to true, it will use Tab (\t) for indentation. If set to a number, it will use that number of spaces for indentation.
  • json5.format.startIgnoreDirective: The start of ignore directive for formatting. Default to json5-fmt: off. Only works for // line comments.
  • json5.format.endIgnoreDirective: The end of ignore directive for formatting. Default to json5-fmt: on. Only works for // line comments.
  • json5.tracing: Traces the communication between VS Code and the JSON5 language server.

Credits

This extension is heavily based on the JSON Language Features extension by Microsoft.

Changelog

See CHANGELOG.md

License

MIT