Add schema definition for the config

This commit is contained in:
Ben Jackson 2019-11-05 18:30:27 +00:00
commit 7297e12605
6 changed files with 656 additions and 0 deletions

35
.ycm_extra_conf.py Normal file
View file

@ -0,0 +1,35 @@
try:
from ycmd.extra_conf_support import IgnoreExtraConf
except ImportError:
IgnoreExtraConf = None
import os.path as p
PATH_TO_THIS_DIR = p.dirname( p.abspath( __file__ ) )
def Settings( **kwargs ):
if kwargs[ 'language' ] == 'json':
return {
'ls': {
'json': {
'schemas': [
{
'fileMatch': [ '.vimspector.json' ],
'url':
f'file://{PATH_TO_THIS_DIR}/docs/schema/vimspector.schema.json'
},
{
'fileMatch': [ '.gadgets.json', '.gadgets.d/*.json' ],
'url':
f'file://{PATH_TO_THIS_DIR}/docs/schema/gadgets.schema.json'
}
]
}
}
}
if IgnoreExtraConf:
raise IgnoreExtraConf()
return None