aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--local-schema.json41
-rw-r--r--settings/json-languageserver.vim2
2 files changed, 42 insertions, 1 deletions
diff --git a/local-schema.json b/local-schema.json
new file mode 100644
index 0000000..aa62b26
--- /dev/null
+++ b/local-schema.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema",
+ "additionalProperties": false,
+ "properties": {
+ "cmd": {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "initialization_options": {
+ "type": "object"
+ },
+ "root_uri": {
+ "type": "string",
+ "pattern": "^file://\\S+$"
+ },
+ "whitelist": {
+ "items": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_-]+$"
+ },
+ "type": "array"
+ },
+ "blacklist": {
+ "items": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_-]+$"
+ },
+ "type": "array"
+ },
+ "config": {
+ "type": "object"
+ },
+ "workspace_config": {
+ "type": "object"
+ }
+ },
+ "title": "vim-lsp-settings-local",
+ "type": "object"
+}
diff --git a/settings/json-languageserver.vim b/settings/json-languageserver.vim
index 7b21b94..3ce405b 100644
--- a/settings/json-languageserver.vim
+++ b/settings/json-languageserver.vim
@@ -8,6 +8,6 @@ augroup vimlsp_settings_json_languageserver
\ 'whitelist': lsp_settings#get('json-languageserver', 'whitelist', ['json', 'jsonc']),
\ 'blacklist': lsp_settings#get('json-languageserver', 'blacklist', []),
\ 'config': lsp_settings#get('json-languageserver', 'config', lsp_settings#server_config('json-languageserver')),
- \ 'workspace_config': lsp_settings#get('json-languageserver', 'workspace_config', {name, key->{'json': {'format': {'enable': v:true}, 'schemas': json_decode(join(readfile(expand('<sfile>:h:h') . '/data/catalog.json'), "\n"))['schemas']}}}),
+ \ 'workspace_config': lsp_settings#get('json-languageserver', 'workspace_config', {name, key->{'json': {'format': {'enable': v:true}, 'schemas': json_decode(join(readfile(expand('<sfile>:h:h') . '/data/catalog.json'), "\n"))['schemas'] + [{'fileMatch':['/.vim-lsp-settings/settings.json'], 'url': 'https://mattn.github.io/local-schema.json'}]}}}),
\ }
augroup END