]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp/autoload/lsp/utils/workspace_config.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / vim-lsp / autoload / lsp / utils / workspace_config.vim
1 function! lsp#utils#workspace_config#get(server_name) abort
2     try
3         let l:server_info = lsp#get_server_info(a:server_name)
4         let l:config_type = type(l:server_info['workspace_config'])
5
6         if l:config_type == v:t_func
7           let l:config = l:server_info['workspace_config'](l:server_info)
8         else
9           let l:config = l:server_info['workspace_config']
10         endif
11
12         return l:config
13     catch
14         return v:null
15     endtry
16 endfunction
17
18 function! lsp#utils#workspace_config#projection(config, item) abort
19     try
20         let l:config = a:config
21
22         for l:section in split(a:item['section'], '\.')
23             let l:config = l:config[l:section]
24         endfor
25
26         return l:config
27     catch
28         return v:null
29     endtry
30 endfunction
31
32 function! lsp#utils#workspace_config#get_value(server_name, item) abort
33     let l:config = lsp#utils#workspace_config#get(a:server_name)
34     return lsp#utils#workspace_config#projection(l:config, a:item)
35 endfunction