aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_vimdoc.py
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-11-12 22:21:34 -0500
committerGitHub <noreply@github.com>2020-11-12 22:21:34 -0500
commitf75be5e9d510d5369c572cf98e78d9480df3b0bb (patch)
treee25baab19bcb47ca0d2edcf0baa18b71cfd03f9e /scripts/gen_vimdoc.py
parent4ae31c46f75aef7d7a80dd2a8d269c168806a1bd (diff)
downloadrneovim-f75be5e9d510d5369c572cf98e78d9480df3b0bb.tar.gz
rneovim-f75be5e9d510d5369c572cf98e78d9480df3b0bb.tar.bz2
rneovim-f75be5e9d510d5369c572cf98e78d9480df3b0bb.zip
lsp: vim.lsp.diagnostic (#12655)
Breaking Changes: - Deprecated all `vim.lsp.util.{*diagnostics*}()` functions. - Instead, all functions must be found in vim.lsp.diagnostic - For now, they issue a warning ONCE per neovim session. In a "little while" we will remove them completely. - `vim.lsp.callbacks` has moved to `vim.lsp.handlers`. - For a "little while" we will just redirect `vim.lsp.callbacks` to `vim.lsp.handlers`. However, we will remove this at some point, so it is recommended that you change all of your references to `callbacks` into `handlers`. - This also means that for functions like |vim.lsp.start_client()| and similar, keyword style arguments have moved from "callbacks" to "handlers". Once again, these are currently being forward, but will cease to be forwarded in a "little while". - Changed the highlight groups for LspDiagnostic highlight as they were inconsistently named. - For more information, see |lsp-highlight-diagnostics| - Changed the sign group names as well, to be consistent with |lsp-highlight-diagnostics| General Enhancements: - Rewrote much of the getting started help document for lsp. It also provides a much nicer configuration strategy, so as to not recommend globally overwriting builtin neovim mappings. LSP Enhancements: - Introduced the concept of |lsp-handlers| which will allow much better customization for users without having to copy & paste entire files / functions / etc. Diagnostic Enhancements: - "goto next diagnostic" |vim.lsp.diagnostic.goto_next()| - "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()| - For each of the gotos, auto open diagnostics is available as a configuration option - Configurable diagnostic handling: - See |vim.lsp.diagnostic.on_publish_diagnostics()| - Delay display until after insert mode - Configure signs - Configure virtual text - Configure underline - Set the location list with the buffers diagnostics. - See |vim.lsp.diagnostic.set_loclist()| - Better performance for getting counts and line diagnostics - They are now cached on save, to enhance lookups. - Particularly useful for checking in statusline, etc. - Actual testing :) - See ./test/functional/plugin/lsp/diagnostic_spec.lua - Added `guisp` for underline highlighting NOTE: "a little while" means enough time to feel like most plugins and plugin authors have had a chance to refactor their code to use the updated calls. Then we will remove them completely. There is no need to keep them, because we don't have any released version of neovim that exposes these APIs. I'm trying to be nice to people following HEAD :) Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
Diffstat (limited to 'scripts/gen_vimdoc.py')
-rwxr-xr-xscripts/gen_vimdoc.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index c42b568220..b1a7f92854 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -143,12 +143,13 @@ CONFIG = {
'section_start_token': '*lsp-core*',
'section_order': [
'lsp.lua',
- 'protocol.lua',
'buf.lua',
- 'callbacks.lua',
+ 'diagnostic.lua',
+ 'handlers.lua',
+ 'util.lua',
'log.lua',
'rpc.lua',
- 'util.lua'
+ 'protocol.lua',
],
'files': ' '.join([
os.path.join(base_dir, 'runtime/lua/vim/lsp'),
@@ -447,7 +448,7 @@ def render_node(n, text, prefix='', indent='', width=62):
indent=indent, width=width))
i = i + 1
elif n.nodeName == 'simplesect' and 'note' == n.getAttribute('kind'):
- text += 'Note:\n '
+ text += '\nNote:\n '
for c in n.childNodes:
text += render_node(c, text, indent=' ', width=width)
text += '\n'
@@ -461,6 +462,8 @@ def render_node(n, text, prefix='', indent='', width=62):
text += ind(' ')
for c in n.childNodes:
text += render_node(c, text, indent=' ', width=width)
+ elif n.nodeName == 'computeroutput':
+ return get_text(n)
else:
raise RuntimeError('unhandled node type: {}\n{}'.format(
n.nodeName, n.toprettyxml(indent=' ', newl='\n')))
@@ -526,6 +529,7 @@ def para_as_map(parent, indent='', width=62):
and is_inline(self_or_child(prev))
and is_inline(self_or_child(child))
and '' != get_text(self_or_child(child)).strip()
+ and text
and ' ' != text[-1]):
text += ' '
@@ -705,7 +709,7 @@ def extract_from_xml(filename, target, width):
if len(prefix) + len(suffix) > lhs:
signature = vimtag.rjust(width) + '\n'
- signature += doc_wrap(suffix, width=width-8, prefix=prefix,
+ signature += doc_wrap(suffix, width=width, prefix=prefix,
func=True)
else:
signature = prefix + suffix