# vscode-json-languageservice

> Language service for JSON

Latest version **6.0.0-next.3** (published 2026-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install vscode-json-languageservice
pnpm add vscode-json-languageservice
yarn add vscode-json-languageservice
bun add vscode-json-languageservice
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0-next.3 |
| Published | 2026-08-21 |
| First published | 2016-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 5 |
| Unpacked size | 353.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 326 |
| Author | Microsoft Corporation |
| Maintainers | microsoft1es, microsoft-oss-releases, alexandrudima, kaimaetzel, sbatten, lszomoru, vscode-bot |

## Links

- npm: https://www.npmjs.com/package/vscode-json-languageservice
- Repository: https://github.com/Microsoft/vscode-json-languageservice
- Homepage: https://github.com/Microsoft/vscode-json-languageservice#readme
- Issues: https://github.com/Microsoft/vscode-json-languageservice
- npm.io page: https://npm.io/package/vscode-json-languageservice

## Dependencies (5)

- [vscode-uri](https://npm.io/package/vscode-uri.md) ^3.1.0
- [@vscode/l10n](https://npm.io/package/@vscode/l10n.md) ^0.0.18
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) 4.0.0-next.1
- [vscode-languageserver-types](https://npm.io/package/vscode-languageserver-types.md) ^3.18.0
- [vscode-languageserver-textdocument](https://npm.io/package/vscode-languageserver-textdocument.md) ^1.0.12

## Recent versions

- 6.0.0-next.3 (latest) — 2026-08-21
- 6.0.0-next.4 (next) — 2026-09-10
- 6.0.0-next.2 — 2026-07-12
- 6.0.0-next.1 — 2026-04-12
- 5.7.2 — 2026-02-23
- 5.7.1 — 2026-01-13
- 5.7.0 — 2026-01-13
- 5.6.4 — 2025-12-01
- 5.6.3 — 2025-11-03
- 5.6.2 — 2025-09-29
- 5.6.1 — 2025-06-30
- 5.6.0 — 2025-06-02
- 5.5.0 — 2025-04-25
- 5.5.1-next.0 — 2025-04-25
- 5.4.5-next.0 — 2025-03-24
- … 164 more at https://npm.io/package/vscode-json-languageservice/versions

## README

# vscode-json-languageservice

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

[![npm Package](https://img.shields.io/npm/v/vscode-json-languageservice.svg?style=flat-square)](https://www.npmjs.org/package/vscode-json-languageservice)
[![NPM Downloads](https://img.shields.io/npm/dm/vscode-json-languageservice.svg)](https://npmjs.org/package/vscode-json-languageservice)
[![Build Status](https://github.com/microsoft/vscode-json-languageservice/actions/workflows/node.js.yml/badge.svg)](https://github.com/microsoft/vscode-json-languageservice/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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](./src/jsonLanguageService.ts) and [jsonLanguageTypes.ts](./src/jsonLanguageTypes.ts)

## Installation

    npm install --save vscode-json-languageservice

## Sample usage

See [sample.ts](./src/example/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](https://user-images.githubusercontent.com/6461412/94239202-bdad4e80-ff11-11ea-99c3-cb9dbeb1c0b2.png)

### 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](https://user-images.githubusercontent.com/6461412/94242925-061b3b00-ff17-11ea-8c17-8da15268f1a1.png)
- set breakpoints, e.g. in `jsonCompletion.ts`
- in the instance run from sources, invoke code completion in the `.json` file

---
_Source: https://npm.io/package/vscode-json-languageservice · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
