LSP-json
Schema validation/completions for your JSON and Sublime files
Details
Installs
- Total 8K
- Win 3K
- Mac 3K
- Linux 2K
Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | Jun 22 | Jun 21 | Jun 20 | Jun 19 | Jun 18 | Jun 17 | Jun 16 | Jun 15 | Jun 14 | Jun 13 | Jun 12 | Jun 11 | Jun 10 | Jun 9 | Jun 8 | Jun 7 | Jun 6 | Jun 5 | Jun 4 | Jun 3 | Jun 2 | Jun 1 | May 31 | May 30 | May 29 | May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 3 | 6 | 6 | 4 | 4 | 5 | 5 | 1 | 5 | 7 | 10 | 6 | 8 | 4 | 4 | 9 | 5 | 9 | 6 | 4 | 2 | 6 | 6 | 2 | 4 | 5 | 2 | 5 | 8 | 3 | 4 | 4 | 2 | 2 | 6 | 5 | 8 | 4 | 7 | 6 | 6 | 2 | 7 | 6 | 1 | 3 |
Mac | 1 | 5 | 3 | 6 | 6 | 2 | 4 | 2 | 9 | 3 | 7 | 7 | 5 | 8 | 7 | 5 | 7 | 4 | 8 | 7 | 10 | 2 | 7 | 6 | 9 | 7 | 3 | 4 | 4 | 10 | 11 | 8 | 5 | 5 | 4 | 5 | 9 | 9 | 3 | 3 | 6 | 4 | 8 | 6 | 5 | 7 |
Linux | 2 | 5 | 9 | 8 | 7 | 8 | 5 | 3 | 4 | 8 | 3 | 6 | 3 | 3 | 8 | 16 | 9 | 4 | 8 | 4 | 3 | 3 | 2 | 8 | 13 | 5 | 1 | 5 | 3 | 11 | 12 | 9 | 2 | 9 | 8 | 5 | 6 | 5 | 6 | 7 | 9 | 3 | 4 | 1 | 4 | 7 |
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.
Installation
- 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
).
For users of PackageDev
The PackageDev package implements features that provide completions and tooltips when editing the Sublime settings files, which overlaps and conflicts with functionality provided by this package. To take advantage of the strict schemas that this package provides, disable corresponding functionality in PackageDev
by opening Preferences: PackageDev Settings
from the Command Palette and set the following settings on the right side:
{
"settings.auto_complete": false,
"settings.tooltip": false
}
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`."
}
},
}
}
]
}
}