]> Sergey Matveev's repositories - vim-lsp.git/blob - autoload/lsp/options.vim
be55f058a40a4723dc51ee30d5fb4e8718377db8
[vim-lsp.git] / autoload / lsp / options.vim
1 vim9script
2
3 # LSP plugin options
4 # User can override these by calling the OptionsSet() function.
5 export var lspOptions: dict<any> = {
6   # Enable ale diagnostics support.
7   # If true, diagnostics will be sent to ale, which will be responsible for
8   # showing them.
9   aleSupport: false,
10   # In insert mode, complete the current symbol automatically
11   # Otherwise, use omni-completion
12   autoComplete: true,
13   # In normal mode, highlight the current symbol automatically
14   autoHighlight: false,
15   # Automatically highlight diagnostics messages from LSP server
16   autoHighlightDiags: true,
17   # Automatically populate the location list with new diagnostics
18   autoPopulateDiags: false,
19   # icase | fuzzy | case match for language servers that replies with a full
20   # list of completion items
21   completionMatcher: 'case',
22   # diagnostics signs options
23   diagSignErrorText: 'E>',
24   diagSignHintText: 'H>',
25   diagSignInfoText: 'I>',
26   diagSignWarningText: 'W>',
27   # In insert mode, echo the current symbol signature in the status line
28   # instead of showing it in a popup
29   echoSignature: false,
30   # hide disabled code actions
31   hideDisabledCodeActions: false,
32   # Highlight diagnostics inline
33   highlightDiagInline: false,
34   # Show the symbol documentation in the preview window instead of in a popup
35   hoverInPreview: false,
36   # Don't print message when a configured language server is missing.
37   ignoreMissingServer: false,
38   # Focus on the location list window after LspDiagShow
39   keepFocusInDiags: true,
40   # Focus on the location list window after LspShowReferences
41   keepFocusInReferences: true,
42   # If true, apply the LSP server supplied text edits after a completion.
43   # If a snippet plugin is going to apply the text edits, then set this to
44   # false to avoid applying the text edits twice.
45   completionTextEdit: true,
46   # Alignment of virtual diagnostic text, when showDiagWithVirtualText is true
47   # Allowed values: 'above' | 'below' | 'after' (default is 'above')
48   diagVirtualTextAlign: 'above',
49   # instead of the signature
50   noDiagHoverOnLine: true,
51   # Suppress adding a new line on completion selection with <CR>
52   noNewlineInCompletion: false,
53   # Open outline window on right side
54   outlineOnRight: false,
55   # Outline window size
56   outlineWinSize: 20,
57   # Make diagnostics show in a popup instead of echoing
58   showDiagInPopup: true,
59   # Suppress diagnostic hover from appearing when the mouse is over the line
60   # Show a diagnostic message on a status line
61   showDiagOnStatusLine: false,
62   # Show a diagnostic messages with virtual text
63   showDiagWithVirtualText: false,
64   # enable inlay hints
65   showInlayHints: false,
66   # In insert mode, show the current symbol signature automatically
67   showSignature: true,
68   # enable snippet completion support
69   snippetSupport: false,
70   # enable SirVer/ultisnips completion support
71   ultisnipsSupport: false,
72   # enable hrsh7th/vim-vsnip completion support
73   vsnipSupport: false,
74   # Use a floating menu to show the code action menu instead of asking for input
75   usePopupInCodeAction: false,
76   # ShowReferences in a quickfix list instead of a location list`
77   useQuickfixForLocations: false,
78   # add to autocomplition list current buffer words
79   useBufferCompletion: false,
80   # Limit the time autocompletion searches for words in current buffer (in milliseconds)
81   bufferCompletionTimeout: 100,
82   # Enable support for custom completion kinds
83   customCompletionKinds: false,
84   # A dictionary with all completion kinds that you want to customize
85   completionKinds: {}
86 }
87
88 # set the LSP plugin options from the user provided option values
89 export def OptionsSet(opts: dict<any>)
90   lspOptions->extend(opts)
91   if !has('patch-9.0.0178')
92     lspOptions.showInlayHints = false
93   endif
94   if !has('patch-9.0.1157')
95     lspOptions.showDiagWithVirtualText = false
96   endif
97 enddef
98
99 # return a copy of the LSP plugin options
100 export def OptionsGet(): dict<any>
101   return lspOptions->deepcopy()
102 enddef
103
104 # vim: tabstop=8 shiftwidth=2 softtabstop=2