mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
JSON Schemas
This commit is contained in:
@@ -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
1406
data/catalog.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user