Skip to content

Commit 4ced372

Browse files
committed
Simplify/organise variable initialisation
1 parent 8d58fb8 commit 4ced372

File tree

5 files changed

+25
-41
lines changed

5 files changed

+25
-41
lines changed

autoload/OmniSharp/actions/complete.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ endfunction
6969

7070
function! s:StdioGetCompletions(partial, Callback) abort
7171
let wantDocPopup = OmniSharp#popup#Enabled()
72-
\ && g:omnicomplete_fetch_full_documentation
72+
\ && g:OmniSharp_complete_documentation
7373
\ && &completeopt =~# 'popup'
7474
let wantDoc = wantDocPopup ? 'false'
75-
\ : g:omnicomplete_fetch_full_documentation ? 'true' : 'false'
75+
\ : g:OmniSharp_complete_documentation ? 'true' : 'false'
7676
let wantSnippet = g:OmniSharp_want_snippet ? 'true' : 'false'
7777
let parameters = {
7878
\ 'WordToComplete': a:partial,
@@ -109,7 +109,7 @@ function! s:StdioGetCompletionsRH(Callback, wantDocPopup, response) abort
109109
\}
110110
if a:wantDocPopup
111111
let completion.info = cmp.MethodHeader . "\n ..."
112-
elseif g:omnicomplete_fetch_full_documentation
112+
elseif g:OmniSharp_complete_documentation
113113
let completion.info = ' '
114114
if has_key(cmp, 'Description') && cmp.Description != v:null
115115
let completion.info = cmp.Description

autoload/OmniSharp/util.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function! OmniSharp#util#CheckCapabilities() abort
124124

125125
if !s:capable
126126
" Clear BufEnter and InsertLeave autocmds
127-
silent! autocmd! OmniSharp_HighlightTypes
127+
silent! autocmd! OmniSharp_Highlighting
128128
" Clear plugin integration autocmds
129129
silent! autocmd! OmniSharp_Integrations
130130
endif

doc/omnisharp-vim.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,13 @@ Window. Type lookups will display in the status line if this is `0`.
381381
Default: 0 >
382382
let g:OmniSharp_typeLookupInPreview = 0
383383
<
384-
*g:omnicomplete_fetch_full_documentation*
384+
*g:OmniSharp_complete_documentation*
385385
Use this option to specify whether OmniSharp will fetch full documentation on
386-
completion suggestions. By default, only type/method signatures are fetched for
387-
performance reasons. Full documentation can still be fetched when needed using
388-
the |:OmniSharpDocumentation| command. Default: 1 >
389-
let g:omnicomplete_fetch_full_documentation = 1
386+
completion suggestions. When set to 0, only type/method signatures are fetched -
387+
full documentation can still be fetched when needed using the
388+
|:OmniSharpDocumentation| command.
389+
Default: 1 >
390+
let g:OmniSharp_complete_documentation = 1
390391
<
391392
===============================================================================
392393
4. COMMANDS *omnisharp-commands*

plugin/OmniSharp.vim

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,28 @@
11
if exists('g:OmniSharp_loaded') | finish | endif
22
let g:OmniSharp_loaded = 1
33

4-
let g:OmniSharp_lookup_metadata = get(g:, 'OmniSharp_lookup_metadata', 1)
5-
6-
" Default to `1`, except in cygwin defaults to `0`
7-
let g:OmniSharp_server_stdio = get(g:, 'OmniSharp_server_stdio', !has('win32unix'))
4+
let g:OmniSharp_server_stdio = get(g:, 'OmniSharp_server_stdio', !has('win32unix')) " Default to 1, except in cygwin
85

6+
" Server selection/initialization variables
7+
let g:OmniSharp_autoselect_existing_sln = get(g:, 'OmniSharp_autoselect_existing_sln', 0)
8+
let g:OmniSharp_prefer_global_sln = get(g:, 'OmniSharp_prefer_global_sln', 0)
99
let g:OmniSharp_server_display_loading = get(g:, 'OmniSharp_server_display_loading', 1)
1010
let g:OmniSharp_server_loading_timeout = get(g:, 'OmniSharp_server_loading_timeout', 180)
11-
12-
" Use mono to start the roslyn server on *nix
1311
let g:OmniSharp_server_use_mono = get(g:, 'OmniSharp_server_use_mono', 0)
14-
15-
let g:OmniSharp_open_quickfix = get(g:, 'OmniSharp_open_quickfix', 1)
16-
17-
let g:OmniSharp_timeout = get(g:, 'OmniSharp_timeout', 1)
18-
19-
" Default to `0`, except in cygwin
20-
let g:OmniSharp_translate_cygwin_wsl = get(g:, 'OmniSharp_translate_cygwin_wsl', has('win32unix'))
21-
22-
let g:OmniSharp_typeLookupInPreview = get(g:, 'OmniSharp_typeLookupInPreview', 0)
23-
2412
let g:OmniSharp_sln_list_index = get(g:, 'OmniSharp_sln_list_index', -1)
25-
26-
let g:OmniSharp_autoselect_existing_sln = get(g:, 'OmniSharp_autoselect_existing_sln', 0)
27-
let g:OmniSharp_prefer_global_sln = get(g:, 'OmniSharp_prefer_global_sln', 0)
13+
let g:OmniSharp_start_server = get(g:, 'OmniSharp_start_server', 1)
2814
let g:OmniSharp_start_without_solution = get(g:, 'OmniSharp_start_without_solution', 1)
2915

30-
" Automatically start server
31-
let g:OmniSharp_start_server = get(g:, 'OmniSharp_start_server', get(g:, 'Omnisharp_start_server', 1))
32-
33-
let defaultlevel = g:OmniSharp_server_stdio ? 'info' : 'warning'
34-
let g:OmniSharp_loglevel = get(g:, 'OmniSharp_loglevel', defaultlevel)
35-
16+
let g:OmniSharp_complete_documentation = get(g:, 'OmniSharp_complete_documentation', get(g:, 'omnicomplete_fetch_full_documentation', 1))
17+
let g:OmniSharp_loglevel = get(g:, 'OmniSharp_loglevel', g:OmniSharp_server_stdio ? 'info' : 'warning')
18+
let g:OmniSharp_lookup_metadata = get(g:, 'OmniSharp_lookup_metadata', 1)
19+
let g:OmniSharp_open_quickfix = get(g:, 'OmniSharp_open_quickfix', 1)
3620
let g:OmniSharp_runtests_parallel = get(g:, 'OmniSharp_runtests_parallel', 1)
3721
let g:OmniSharp_runtests_echo_output = get(g:, 'OmniSharp_runtests_echo_output', 1)
38-
39-
" Set to 1 when ultisnips is installed
40-
let g:OmniSharp_want_snippet = get(g:, 'OmniSharp_want_snippet', 0)
41-
42-
let g:omnicomplete_fetch_full_documentation = get(g:, 'omnicomplete_fetch_full_documentation', 1)
22+
let g:OmniSharp_timeout = get(g:, 'OmniSharp_timeout', 1)
23+
let g:OmniSharp_translate_cygwin_wsl = get(g:, 'OmniSharp_translate_cygwin_wsl', has('win32unix')) " Default to 0, except in cygwin
24+
let g:OmniSharp_typeLookupInPreview = get(g:, 'OmniSharp_typeLookupInPreview', 0)
25+
let g:OmniSharp_want_snippet = get(g:, 'OmniSharp_want_snippet', 0) " Set to 1 when ultisnips is installed
4326

4427
command! -bar -nargs=? OmniSharpInstall call OmniSharp#Install(<f-args>)
4528
command! -bar -nargs=? OmniSharpOpenLog call OmniSharp#log#Open(<q-args>)
@@ -49,7 +32,7 @@ command! -bar -bang OmniSharpStatus call OmniSharp#Status(<bang>0)
4932
" Preserve backwards compatibility with older version g:OmniSharp_highlight_types
5033
let g:OmniSharp_highlighting = get(g:, 'OmniSharp_highlighting', get(g:, 'OmniSharp_highlight_types', 2))
5134
if g:OmniSharp_highlighting
52-
augroup OmniSharp_HighlightTypes
35+
augroup OmniSharp_Highlighting
5336
autocmd!
5437
autocmd BufEnter *.cs,*.csx
5538
\ if !pumvisible() && OmniSharp#util#CheckCapabilities() |

python/omnisharp/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def getCompletions(partialWord):
6161
parameters['WordToComplete'] = partialWord
6262

6363
parameters['WantDocumentationForEveryCompletionResult'] = \
64-
bool(int(vim.eval('g:omnicomplete_fetch_full_documentation')))
64+
bool(int(vim.eval('g:OmniSharp_complete_documentation')))
6565

6666
want_snippet = \
6767
bool(int(vim.eval('g:OmniSharp_want_snippet')))

0 commit comments

Comments
 (0)