vscode-json-languageservice
Language service for JSON
Last updated 2 years ago by aeschli .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install vscode-json-languageservice 
SYNC missed versions from official npm registry.

vscode-json-languageservice

JSON language service extracted from VSCode to be reused, e.g in the Monaco editor.

npm Package NPM Downloads Build Status License: MIT

Why?

The vscode-json-languageservice contains the language smarts behind the JSON editing experience of Visual Studio Code and the Monaco editor.

  • doValidation analyses an input string and returns syntax and lint errors.
  • doComplete provides completion proposals for a given location.
  • doResolve resolves a completion proposals.
  • doHover provides a hover text for a given location.
  • findDocumentSymbols provides all symbols in the given document.
  • findDocumentColors provides all color symbols in the given document.
  • getColorPresentations returns available color formats for a color symbol.
  • format formats the code at the given range.
  • getFoldingRanges gets folding ranges for the given document.
  • getSelectionRanges gets selection ranges for a given location.
  • getMatchingSchemas matches a document against its schema and returns all AST nodes along with the matching sub schemas.
  • parseJSONDocument creates a JSON document from source code.
  • newJSONDocument creates a JSON document from an AST.

For the complete API see jsonLanguageService.ts and jsonLanguageTypes.ts

Installation

npm install --save vscode-json-languageservice

Sample usage

See sample.ts for an example on how to use the JSON language service.

To run the sample use yarn sample

Development

git clone https://github.com/microsoft/vscode-json-languageservice
cd vscode-json-languageservice
yarn

Use yarn test to compile and run tests

How can I run and debug the service?

  • open the folder in VSCode.
  • set breakpoints, e.g. in jsonCompletion.ts
  • run the Unit tests from the run viewlet and wait until a breakpoint is hit: image

How can I run and debug the service inside an instance of VSCode?

  • run VSCode out of sources setup as described here: https://github.com/Microsoft/vscode/wiki/How-to-Contribute
  • use yarn link vscode-json-languageservice in vscode/extensions/json-language-features/server to run VSCode with the latest changes from vscode-json-languageservice
  • run VSCode out of source (vscode/scripts/code.sh|bat) and open a .json file
  • in VSCode window that is open on the vscode-json-languageservice sources, run command Debug: Attach to Node process and pick the code-oss process with the json-language-features path image
  • set breakpoints, e.g. in jsonCompletion.ts
  • in the instance run from sources, invoke code completion in the .json file

Current Tags

  • 5.3.2                                ...           latest (2 years ago)
  • 5.3.2                                ...           next (2 years ago)

150 Versions

  • 5.3.2                                ...           2 years ago
  • 5.3.1                                ...           2 years ago
  • 5.3.0                                ...           2 years ago
  • 5.2.0                                ...           2 years ago
  • 5.1.4                                ...           2 years ago
  • 5.1.3                                ...           2 years ago
  • 5.1.2                                ...           2 years ago
  • 5.1.1                                ...           2 years ago
  • 5.1.0                                ...           2 years ago
  • 5.0.0                                ...           3 years ago
  • 4.2.1                                ...           3 years ago
  • 4.2.0                                ...           3 years ago
  • 4.2.0-next.3                                ...           3 years ago
  • 4.2.0-next.2                                ...           3 years ago
  • 4.2.0-next.1                                ...           3 years ago
  • 4.2.0-next.0                                ...           3 years ago
  • 4.1.10                                ...           3 years ago
  • 4.1.9                                ...           3 years ago
  • 4.1.8                                ...           3 years ago
  • 4.1.7                                ...           3 years ago
  • 4.1.6                                ...           3 years ago
  • 4.1.5                                ...           3 years ago
  • 4.1.4                                ...           4 years ago
  • 4.1.3                                ...           4 years ago
  • 4.1.2                                ...           4 years ago
  • 4.1.0                                ...           4 years ago
  • 4.0.2                                ...           4 years ago
  • 4.0.1                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.11.0                                ...           4 years ago
  • 3.10.0                                ...           4 years ago
  • 3.9.1                                ...           4 years ago
  • 3.9.0                                ...           4 years ago
  • 3.8.5                                ...           4 years ago
  • 3.8.4                                ...           4 years ago
  • 3.8.3                                ...           4 years ago
  • 3.8.2                                ...           4 years ago
  • 3.8.1                                ...           4 years ago
  • 3.8.0                                ...           4 years ago
  • 3.7.0                                ...           5 years ago
  • 3.6.0                                ...           5 years ago
  • 3.5.2                                ...           5 years ago
  • 3.5.1                                ...           5 years ago
  • 3.4.12                                ...           5 years ago
  • 3.4.11                                ...           5 years ago
  • 3.4.10                                ...           5 years ago
  • 3.4.9                                ...           5 years ago
  • 3.4.8                                ...           5 years ago
  • 3.4.7                                ...           5 years ago
  • 3.4.6                                ...           5 years ago
  • 3.4.5                                ...           5 years ago
  • 3.4.4                                ...           5 years ago
  • 3.4.3                                ...           5 years ago
  • 3.4.1                                ...           5 years ago
  • 3.4.0                                ...           5 years ago
  • 3.3.5                                ...           5 years ago
  • 3.3.4                                ...           5 years ago
  • 3.3.3                                ...           5 years ago
  • 3.3.2                                ...           5 years ago
  • 3.3.1                                ...           5 years ago
  • 3.3.0                                ...           5 years ago
  • 3.3.0-next.7                                ...           6 years ago
  • 3.3.0-next.6                                ...           6 years ago
  • 3.3.0-next.5                                ...           6 years ago
  • 3.3.0-next.4                                ...           6 years ago
  • 3.3.0-next.3                                ...           6 years ago
  • 3.3.0-next.2                                ...           6 years ago
  • 3.3.0-next.1                                ...           6 years ago
  • 3.3.0-next.0                                ...           6 years ago
  • 3.2.1                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.2.0-next.2                                ...           6 years ago
  • 3.2.0-next.1                                ...           6 years ago
  • 3.1.7                                ...           6 years ago
  • 3.1.6                                ...           6 years ago
  • 3.1.5                                ...           6 years ago
  • 3.1.4                                ...           6 years ago
  • 3.1.3                                ...           6 years ago
  • 3.1.2                                ...           6 years ago
  • 3.1.2-next.3                                ...           7 years ago
  • 3.1.2-next.2                                ...           7 years ago
  • 3.1.2-next.1                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.13                                ...           7 years ago
  • 3.0.12                                ...           7 years ago
  • 3.0.11                                ...           7 years ago
  • 3.0.10                                ...           7 years ago
  • 3.0.8                                ...           7 years ago
  • 3.0.7                                ...           7 years ago
  • 3.0.6                                ...           7 years ago
  • 3.0.5                                ...           7 years ago
  • 3.0.4                                ...           7 years ago
  • 3.0.3                                ...           7 years ago
  • 3.0.2                                ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.0.22                                ...           7 years ago
  • 2.0.21                                ...           7 years ago
  • 2.0.20                                ...           7 years ago
  • 2.0.19                                ...           7 years ago
  • 2.0.18                                ...           7 years ago
  • 2.0.17                                ...           7 years ago
  • 2.0.16                                ...           7 years ago
  • 2.0.15                                ...           7 years ago
  • 2.0.14                                ...           7 years ago
  • 2.0.13                                ...           7 years ago
  • 2.0.12                                ...           7 years ago
  • 2.0.11                                ...           7 years ago
  • 2.0.10                                ...           7 years ago
  • 2.0.9                                ...           8 years ago
  • 2.0.8                                ...           8 years ago
  • 2.0.7                                ...           8 years ago
  • 2.0.6                                ...           8 years ago
  • 2.0.5                                ...           8 years ago
  • 2.0.4                                ...           8 years ago
  • 2.0.3                                ...           8 years ago
  • 2.0.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 2.0.0-next.12                                ...           8 years ago
  • 1.1.9                                ...           8 years ago
  • 1.1.8                                ...           8 years ago
  • 2.0.0-next.11                                ...           8 years ago
  • 2.0.0-next.10                                ...           8 years ago
  • 2.0.0-next.9                                ...           8 years ago
  • 2.0.0-next.8                                ...           8 years ago
  • 2.0.0-next.7                                ...           8 years ago
  • 2.0.0-next.6                                ...           8 years ago
  • 2.0.0-next.5                                ...           8 years ago
  • 2.0.0-next.4                                ...           8 years ago
  • 2.0.0-next.3                                ...           8 years ago
  • 2.0.0-next.2                                ...           8 years ago
  • 1.1.8-next.2                                ...           8 years ago
  • 1.1.8-next.1                                ...           8 years ago
  • 1.1.7                                ...           8 years ago
  • 1.1.6                                ...           8 years ago
  • 1.1.5-next.2                                ...           8 years ago
  • 1.1.5-next.1                                ...           8 years ago
  • 1.1.4                                ...           8 years ago
  • 1.1.3-next.7                                ...           8 years ago
  • 1.1.3-next.6                                ...           8 years ago
  • 1.1.3-next.5                                ...           8 years ago
  • 1.1.3-next.4                                ...           8 years ago
  • 1.1.3-next.3                                ...           8 years ago
  • 1.1.3-next.2                                ...           8 years ago
  • 1.1.3-next.1                                ...           8 years ago
  • 1.1.2                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (9)

Copyright 2013 - present © cnpmjs.org | Home |