JSON Schemas

This commit is contained in:
Yasuhiro Matsumoto
2020-01-18 23:52:52 +09:00
parent 9250096699
commit 2eb802d2bd
3 changed files with 1413 additions and 1 deletions

View File

@@ -4,6 +4,9 @@ function! lsp_settings#get(name, key, default) abort
let l:config = get(g:, 'lsp_settings', {})
if !has_key(l:config, a:name)
if !has_key(l:config, '*')
if type(a:default) ==# v:t_func
return a:default()
endif
return a:default
endif
let l:config = l:config['*']
@@ -11,6 +14,9 @@ function! lsp_settings#get(name, key, default) abort
let l:config = l:config[a:name]
endif
if !has_key(l:config, a:key)
if type(a:default) ==# v:t_func
return a:default()
endif
return a:default
endif
return l:config[a:key]

1406
data/catalog.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,6 @@ augroup vimlsp_settings_json_languageserver
\ 'whitelist': lsp_settings#get('json-languageserver', 'whitelist', ['json']),
\ 'blacklist': lsp_settings#get('json-languageserver', 'blacklist', []),
\ 'config': lsp_settings#get('json-languageserver', 'config', {}),
\ 'workspace_config': lsp_settings#get('json-languageserver', 'workspace_config', {}),
\ 'workspace_config': lsp_settings#get('json-languageserver', 'workspace_config', {->{'json': {'format': {'enable': v:true}, 'schemas': json_decode(join(readfile(expand('<sfile>:h:h') . '/data/catalog.json'), "\n"))['schemas']}}}),
\ }
augroup END