mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Add json schema
This commit is contained in:
@@ -17,6 +17,8 @@ let s:servers_dir = expand('<sfile>:h:h').'/servers'
|
||||
let s:settings = json_decode(join(readfile(expand('<sfile>:h:h').'/settings.json'), "\n"))
|
||||
let s:ftmap = {}
|
||||
|
||||
call remove(s:settings, '$schema')
|
||||
|
||||
function! s:executable(cmd) abort
|
||||
if executable(a:cmd)
|
||||
return 1
|
||||
|
||||
56
schema.json
Normal file
56
schema.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema",
|
||||
"type": "object",
|
||||
"title": "vim-lsp-settings",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^\\$schema$": {
|
||||
"type": "string"
|
||||
},
|
||||
"^([a-z0-9_-]+)+$": {
|
||||
"type": "array",
|
||||
"title": "filetype name",
|
||||
"items": {
|
||||
"title": "define command description",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"command",
|
||||
"requires"
|
||||
],
|
||||
"properties": {
|
||||
"command": {
|
||||
"title": "define name of language server",
|
||||
"type": "string"
|
||||
},
|
||||
"requires": {
|
||||
"title": "define commands to install this language server",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"title": "executable command name"
|
||||
}
|
||||
},
|
||||
"vim-plugin": {
|
||||
"title": "define suggestion for vim-plugin",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"extensions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"title": "file extensions"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "plugin identify user/repo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "./schema.json",
|
||||
"c": [
|
||||
{
|
||||
"command": "clangd",
|
||||
|
||||
Reference in New Issue
Block a user