Commit Graph

5616 Commits

Author SHA1 Message Date
zeertzjq
57fda7688b
vim-patch:9.0.1659: Termdebug: default highlight cleared if changing colorscheme (#24139)
Problem:    Termdebug: default highlight cleared when changing colorscheme.
Solution:   Use a ColorScheme autocommand. (Christian Brabandt, closes vim/vim#12566,
            closes vim/vim#12555)

279de0cd1f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-24 22:14:57 +08:00
Christian Clason
c2d696f009
Merge pull request #24082 from smjonas/fix_24064
fix(filetype): correctly detect bash-fc-{id} files as "sh" (vim-patch:9.0.1644)
2023-06-24 13:41:50 +02:00
Chinmay Dalal
fa0a25dcb3
fix(lsp): error in reset_timer on second detach #24117
Problem:
On running `zig fmt` manually, the on_lines callback and the
server both detach (for some reason), and both of them call
`clear()`. This fixes it, otherwise the second one to detach
has an error in `reset_timer` since the bufstate doesn't exist

Solution:
* exit early in clear if `bufstates[bufnr]` is nil
* set bufstatte.enabled to true on reload instead of making bufstate nil
2023-06-23 16:33:15 -07:00
smjonas
fdf5013e21 fix(filetype): correctly detect bash-fc-{id} files as "sh" 2023-06-23 18:18:33 +02:00
Raphael
4dc86477b6
build(luarc.json): disable luadoc-miss-see-name #24108 2023-06-23 04:54:47 -07:00
Chinmay Dalal
94a904b453
fix(lsp): reapplying already-applied hints #24114
Problem:
The decoration provider clears the whole buffer then redraws all the hints every
time the window was redrawn. This may lead to an infinite loop.

Solution:
Store the last applied version for a line and only clear and redraw the line if
the buffer version has changed.
2023-06-23 04:49:54 -07:00
Mathias Fußenegger
12c2c16acf
feat(lsp): opt-in to dynamicRegistration for inlay hints (#24102)
Since https://github.com/neovim/neovim/pull/23681 there is dynamic
registration support. We should use that for new features unless there
is a good reason to turn it off.
2023-06-22 19:39:57 +02:00
Christian Clason
904ad5458d
vim-patch:9.0.1645: zserio files are not recognized (#24120)
Problem:    zserio files are not recognized.
Solution:   Add a pattern for zserio files. (Dominique Pellé,
            closes vim/vim#12544)

2b994da57a

Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
2023-06-22 19:38:49 +02:00
zeertzjq
f0884f21fa
feat(extmarks): support hl_mode "combine" for inline virt_text (#24099) 2023-06-22 20:39:35 +08:00
Mathias Fußenegger
134b9ec483
feat(lsp): soft deprecate vim.lsp.for_each_buffer_client (#24104)
There is no need for two ways to access all clients of a buffer.

This doesn't add a `vim.deprecate` call yet, as the function is probably
used a lot, but removes it from the documentation and annotates it with
`@deprecated`
2023-06-22 13:54:35 +02:00
Justin M. Keyes
2f17ef1fc4
fix(messages): use "Vimscript" instead of "VimL" #24111
followup to #24109
fix #16150
2023-06-22 04:09:14 -07:00
Justin M. Keyes
4e6356559c
test: spellcheck :help (vimdoc) files #24109
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.

This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
2023-06-22 03:44:51 -07:00
Justin M. Keyes
130b8c801a
Merge #24087 from justinmk/doc
docs: lsp, fix errors, gen_help_html features
2023-06-22 01:51:20 -07:00
Mathias Fußenegger
4d3a04279d
perf(lsp): remove grouping logic from lsp.status (#24096)
With the title carry-over logic in the `$/progress` handler it's not
necessary to group again in vim.lsp.status
2023-06-22 10:18:49 +02:00
Justin M. Keyes
d931b829e9 fix(docs): vimdoc syntax errors
Since https://github.com/neovim/tree-sitter-vimdoc/pull/97
the many cases of *.foo cause parser errors. But even before that, these
were erroneously highlighted as (argument), so fixing them is good.
2023-06-22 10:18:24 +02:00
Justin M. Keyes
5c73b1bb4c docs: lsp, vim_diff
- quickstart
- mark lsp.txt as `new_layout`
- remove lsp-handler documentation for notifications: they don't have
  handlers because they don't have server responses.
2023-06-22 10:18:17 +02:00
Julian Grinblat
43e76cc346
fix: tostring(vim.version()) fails if build is NIL #24097
Problem:
Since #23925, Version.build may be vim.NIL, which causes tostring() to fail:
    E5108: Error executing lua E5114: Error while converting print argument #1: …/version.lua:129:
    attempt to concatenate field 'build' (a userdata value)
    stack traceback:
            [C]: in function 'print'
            [string ":lua"]:1: in main chunk

Solution:
Handle vim.NIL in Version:__tostring().
2023-06-22 00:36:38 -07:00
Gregory Anders
08db61b19b
feat(man): respect 'wrapmargin' when wrapping man pages (#24091) 2023-06-21 14:42:23 -05:00
Justin M. Keyes
59048814fd docs(lsp): mention ctx.version
Since 643546b82b the request handler
context (`ctx`) includes a `version` field.
2023-06-21 12:32:54 +02:00
Justin M. Keyes
21b074feb0 refactor(lsp): report full Nvim version string in clientInfo 2023-06-21 12:16:26 +02:00
Justin M. Keyes
8d4a53fe6e
fix(vim.json)!: remove global options, "null", "array_mt" #24070
Problem:
- `vim.json` exposes various global options which:
  - affect all Nvim Lua plugins (especially the LSP client)
  - are undocumented and untested
  - can cause confusing problems such as: cc76ae3abe
- `vim.json` exposes redundant mechanisms:
  - `vim.json.null` is redundant with `vim.NIL`.
  - `array_mt` is redundant because Nvim uses a metatable
    (`vim.empty_dict()`) for empty dict instead, which `vim.json` is
    configured to use by default (see `as_empty_dict`).
    Example:
    ```
    :lua vim.print(vim.json.decode('{"bar":[],"foo":{}}'))
    --> { bar = {},  foo = vim.empty_dict() }
    ```
    Thus we don't need to also decorate empty arrays with `array_mt`.

Solution:
Remove the functions from the public vim.json interface.
Comment-out the implementation code to minimize drift from upstream.

TODO:
- Expose the options as arguments to `vim.json.new()`
2023-06-21 01:10:32 -07:00
Akin
e42fdaad21
fix(lsp): add spacing for inlay hints separately #24079
Problem:
Spacing around inlay hints has the same highlight as the hint itself.
The LSP spec for inlay hints specifically mentions the padding should not be
coloured:

    /**
    Render padding before the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingLeft?: boolean;
    /**
    Render padding after the hint.
    Note: Padding should use the editor's background color, not the
    background color of the hint itself. That means padding can be used
    to visually align/separate an inlay hint.
    */
    paddingRight?: boolean;

Solution:
Add the space as separate parts of the virtual text, don't add the space to the
text itself.
2023-06-21 00:55:19 -07:00
Sooryakiran Ponnath
3bf887f6e0
fix(lsp): always return boolean in lsp.buf_client_attach (#24077)
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-06-20 21:17:13 +02:00
Chinmay Dalal
d3e0352574
fix(lsp): check if inlay hints are enabled for a buffer before disabling (#24074)
disabling before enabling throws an error otherwise, because bufstate[bufnr]
doesn't exist
2023-06-20 18:36:31 +02:00
Mathias Fußenegger
64f2691a98
refactor(lsp): extract common execute command functionality (#24065) 2023-06-20 18:36:18 +02:00
Chinmay Dalal
19eef8156b
docs(lsp): LspInlayHint highlight group #24071 2023-06-20 03:20:17 -07:00
Chinmay Dalal
96b94f8d77
fix(lsp): duplicate on_detach, on_reload callbacks #24067
M.enable already clears bufstate[bufnr] and the namespace,
the duplicate callbacks cause an error (indexing bufstate[bufnr] fails)
2023-06-20 02:36:06 -07:00
Chinmay Dalal
ca5de9306c
feat(lsp): inlay hints #23984
Add automatic refresh and a public interface on top of #23736

 * add on_reload, on_detach handlers in `enable()` buf_attach, and
  LspDetach autocommand in case of manual detach
* unify `__buffers` and `hint_cache_by_buf`
* use callback bufnr in `on_lines` callback, bufstate: remove __index override
* move user-facing functions into vim.lsp.buf, unify enable/disable/toggle

Closes #18086
2023-06-19 23:06:54 -07:00
Justin M. Keyes
72a6643b13
docs #24061
- nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932
- NVIM_APPNAME: UIs normally should NOT set this.

ref #23520
fix #24050
fix #23660
fix #23353
fix #23337
fix #22213
fix #19161
fix #18088
fix #20693
2023-06-19 08:40:33 -07:00
bfredl
0d149bb186 fix(docs): the runtimepath is not the runtime path 2023-06-19 14:43:36 +02:00
Justin M. Keyes
cee981bf09
docs #22363
Co-authored by: zeertzjq <zeertzjq@outlook.com>
Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com>
Co-authored by: nobe4 <nobe4@users.noreply.github.com>

- docs: mention --luadev-mod to run with lua runtime files
  When changing a lua file in the ./runtime folder, a new contributor
  might expect changes to be applied to the built Neovim binary.
2023-06-19 02:24:44 -07:00
Santos Gallegos
8c9dab3e0d
fix(treesitter): use vim.highlight.priorities instead of hardcoded 100 (#24052)
Problem: Treesitter highlighting base priority cannot be customized.

Solution: Use `vim.highlight.priorities.treesitter` instead of hard-coded value.
2023-06-18 16:42:17 +02:00
Evgeni Chasnovski
8a7e3353eb
fix(fs): make normalize() work with '/' path (#24047)
Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.

Co-authored by: notomo <notomo.motono@gmail.com>
2023-06-18 06:49:33 -05:00
Jonas Strittmatter
c07dceba33
fix(lsp): allow Lua pattern chars in code action filter (#24041)
Previously, filtering code actions with the "only" option failed
if the code action kind contained special Lua pattern chars such as "-"
(e.g. the ocaml language server supports a "type-annotate" code action).

Solution: use string comparison instead of string.find
2023-06-17 08:01:31 +02:00
Erich Gubler
cf6cffda89
docs(ex_cmds): migration from "behave xterm" #24024 2023-06-14 15:23:15 -07:00
zeertzjq
bbb934e775
vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)
Problem:    Having utf16idx() rounding up is inconvenient.
Solution:   Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523)

95707037af

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-14 20:54:11 +08:00
Jon Huhn
79a5b89d66
perf(lsp): reduce polling handles for workspace/didChangeWatchedFiles (#23500)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-06-14 12:40:11 +02:00
Rohit Sukumaran
bc67bbe446
fix(codelens): add buffer and line checks before displaying codelens (#23887)
Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
2023-06-13 16:17:35 +01:00
Mathias Fußenegger
91f67fabe6
fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#24013)
Fixes a `Invalid buffer id: 123` race when the buffer gets deleted before
the callback triggered.

Alternative to https://github.com/neovim/neovim/pull/23981
2023-06-13 16:53:13 +02:00
zeertzjq
0eb02ea90a
docs: various clarifications (#23999)
Close #18907
Close #20314
Close #23749
2023-06-12 20:08:08 +08:00
Justin M. Keyes
6e1fa16dde
Merge #23954 vim.version() returns Version object 2023-06-11 16:32:37 -07:00
Justin M. Keyes
e688793253 feat: tostring(vim.version())
Problem:
tostring(vim.version()) returns "table: 0x…".

Solution:
Modify vim.version() to return a string prerelease instead of a boolean.

Fix #23863
2023-06-12 01:14:33 +02:00
Stanislav Asunkin
d3b9feccb3
docs: fix vim.tbl_get type annotations #23992 2023-06-11 15:48:13 -07:00
Gianmaria Bajo
ecdb6465e2 feat: vim.version() returns a Version object
- vim.version() returns a Version object.
  Makes it printable and removes the need of workarounds when passing it
  to other vim.version methods.
2023-06-12 00:09:10 +02:00
jdrouhard
385a1facf2
docs: semantic token methods in :h lsp-method #23991 2023-06-11 14:48:57 -07:00
Stephan Seitz
ceb37ff1d8
refactor(treesitter): use npcall in _query_linter.lua #23985 2023-06-11 14:46:22 -07:00
zeertzjq
bde59e8147
fix(remote): restore previous --remote-expr output formatting (#23988)
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.
2023-06-11 22:12:32 +08:00
zeertzjq
72de8fdeeb
vim-patch:f1dcd14fc5d4 (#23986)
Update runtime files

f1dcd14fc5

:autocmd-block is N/A (Vim9 script)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 20:04:59 +08:00
Sean Dewar
473a216a21
vim-patch:10e8ff9b2607 (#23977)
Update runtime files

10e8ff9b26

Also:
- fix a missing `<` in builtin.txt.
- edit `:function` `{name}` wording to match the change made for the docs above
  by Justin in #10619.
- link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua`
  may also be used).

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 12:40:22 +01:00
Chinmay Dalal
643546b82b
feat(lsp): add handlers for inlay hints (#23736)
initial support; public API left for a follow-up PR
2023-06-11 11:53:37 +02:00