coc-json


Ⅰ. 插件描述

Json language extension for coc.nvim

Ⅱ. 基本信息

创建日期:  2018-09-07
使用用户:  42
Github星:  63
插件作者:  neoclide

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'neoclide/coc-json'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'neoclide/coc-json'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'neoclide/coc-json'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/neoclide/coc-json

Ⅳ. 文档说明

# coc-json

Json language server extension for coc.nvim.

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

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.<Paste>
  • 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.

Configuration options

  • json.enable set to false to disable json language server.
  • json.trace.server trace LSP traffic in output channel.
  • json.execArgv add execArgv to child_process.fork used for start
    json language server.
  • json.format.enable set to false to disable format.
  • json.schemas schema associations for json files.

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

添加新评论