ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-json

by sublimelsp ST3

JSON support for Sublime's LSP plugin

Details

Installs

  • Total 867
  • Win 250
  • Mac 383
  • Linux 234
Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16
Windows 0 1 1 0 1 3 6 1 0 1 1 2 0 1 0 2 0 2 2 1 0 0 0 0 1 0 0 1 1 1 2 0 0 0 0 0 2 2 0 0 0 0 1 0 1 2
Mac 0 1 0 1 2 1 5 1 4 1 1 1 1 0 0 2 4 2 3 1 0 1 1 0 1 2 4 0 2 0 0 1 2 2 2 0 0 0 4 0 3 0 1 2 1 2
Linux 0 0 0 1 2 1 0 1 1 1 0 0 1 2 1 1 0 0 1 0 0 0 0 1 1 1 2 0 0 0 1 1 2 0 0 1 3 0 1 0 0 0 0 0 0 1

Readme

Source
raw.​githubusercontent.​com

LSP-json

JSON support for Sublime's LSP plugin.

Uses VSCode JSON Language Server to provide validation, formatting and other features for JSON files. See linked repository for more information.

  • Install LSP and LSP-json from Package Control.
  • Restart Sublime.

Configuration

Open configuration file using command palette with Preferences: LSP-json Settings command or opening it from the Sublime menu (Preferences > Package Settings > LSP > Servers > LSP-json).

Custom schemas

To load manually created schemas, add those to userSchemas configuration in the settings file. See more information in the comments there.

Schemas contributed by Packages

Sublime Text packages can provide schemas for its own settings, or contribute to global ST settings or other configuration files (for example *.sublime-project files).

This is accomplished by including a sublime-package.json file in the package (location doesn't matter) and defining schemas within it. Any changes made to the schemas are automatically applied to matching files so there is no need to restart the server or ST.

Here is a an example of three different schemas defined in one sublime-package.json file:

{
  "contributions": {
    "settings": [
      {
        // Schema for MyPackage configuration.
        "file_patterns": ["/MyPackage.sublime-settings"],
        "schema": {
          "properties": {
            "my_cool_setting": {
              "type": "string",
              "default": "yes",
              "enum": ["yes", "no"],
              "markdownDescription": "Decides whether something is `on` or `off`."
            }
          },
          "additionalProperties": false,
        }
      },
      {
        // Schema to extend global ST Preferences.
        "file_patterns": ["/Preferences.sublime-settings"],
        "schema": {
          "properties": {
            "my_cool_setting": {
              // Reuses definition from the pattern-less schema defined below.
              "$ref": "sublime://settings/foo/base#/definitions/ReuseMe"
            }
          },
        }
      },
      {
        // Pattern-less schema (note that "file_patterns" is missing).
        // Can be added for the purpose of referencing it (or its definitions) from another schema.
        // Pattern-less schema must define an "$id" to be able to refer to it from other schemas.
        // It's recommended to assign URIs like "sublime://settings/foo/base" for "$id".
        "schema": {
          "$id": "sublime://settings/foo/base"
          "definitions": {
            "ReuseMe": {
              "type": "string",
              "default": "no",
              "enum": ["yes", "no"],
              "markdownDescription": "Decides whether something is `on` or `off`."
            }
          },
        }
      }
    ]
  }
}