coc-json

1.9.2 • Public • Published

coc-json

Json language server extension for coc.nvim.

The server code is extracted from VSCode, which uses vscode-json-languageservice

For highlight of jsonc filetype, you may need jsonc.vim

Install

In your vim/neovim, run the following command:

:CocInstall coc-json

Features

Same as VSCode.

All features of vscode-json-languageservice are supported.

  • doCompletion for JSON properties and values based on the document's JSON schema.
  • doHover for values based on descriptions in the document's JSON schema.
  • Document Symbols for quick navigation to properties in the document.
  • Document Colors for showing color decorators on values representing colors.
  • Code Formatting supporting ranges and formatting the whole document.
  • Diagnostics (Validation) are pushed for all open documents
    • syntax errors
    • structural validation based on the document's JSON schema.

Commands

  • json.clearCache: Clear schema cache.
  • json.retryResolveSchema: Retry resolve schema of current buffer.
  • json.sort: Sort json document.

Configuration options

  • json.enable: Enable json server default: true
  • json.enableDefaultSchemas: Enable builtin schemas from https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/api/json/catalog.json default: true
  • json.trace.server: default: "off" Valid options: ["off","messages","verbose"]
  • json.execArgv: default: []
  • json.validate.enable: Enable/disable JSON validation. default: true
  • json.format.enable: Enable format for json server default: true
  • json.format.keepLines: Keep all existing new lines when formatting. default: false
  • json.maxItemsComputed: The maximum number of outline symbols and folding regions computed (limited for performance reasons). default: 5000
  • json.schemaDownload.enable: When enabled, JSON schemas can be fetched from http and https locations. default: true
  • json.schemas: Schemas associations for json files default: []

FAQ

How to suppress error [json 521] [e] Comments are not permitted in JSON?

You can configure your vim to make that file with jsonc filetype to allow comment.

How to add custom schema definitions/properties?

You have two choices:

Quotes are hidden?

This is not caused by coc-json, you may checkout the conceallevel option.

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.9.21,311latest

Version History

VersionDownloads (Last 7 Days)Published
1.9.21,311
1.9.10
1.9.00
1.8.00
1.7.10
1.7.00
1.6.10
1.6.00
1.5.00
1.4.20
1.4.11
1.4.01
1.3.60
1.3.53
1.3.40
1.3.30
1.3.20
1.3.11
1.3.00
1.2.62
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.10
1.1.05
1.0.170
1.0.161
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.94
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.20
1.0.11
1.0.00

Package Sidebar

Install

npm i coc-json

Weekly Downloads

1,151

Version

1.9.2

License

MIT

Unpacked Size

703 kB

Total Files

5

Last publish

Collaborators

  • chemzqm