Commit Graph

200 Commits

Author SHA1 Message Date
caa6992a10 chore: fix typos (#16361)
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-27 11:10:48 -05:00
102e7e7929 fix(lsp): require bufnr for apply_text_edits (#16444) 2021-11-26 10:36:37 +01:00
f2722884a8 perf(lsp)!: use faster line retrieval for utf-16 to byte idx conversion (#16360) 2021-11-24 20:49:34 -05:00
c132144d24 fix(ui): use nowait for q mapping in floating window (#16427) 2021-11-24 15:57:33 -07:00
eb3d59126e fix(lsp): change signature of buf_highlight_references (#16345)
the prior signature did not assume an active language client
this function can now be used directly by passing an offset encoding
defaults to utf-16 (standard for LSP)
2021-11-17 21:14:45 +01:00
ee3a58d42e fix(lsp): ensure buffers are re-attached on rename (#16266)
If a LSP server sent a workspace edit containing a rename the buffers
file name changed without the server receiving a close notification for
the old buffer and without the client properly re-attaching on the new
file.

This affected `Move` code-actions in nvim-jdtls, but also
`vim.lsp.buf.rename` on a class level.
2021-11-14 12:55:16 +01:00
2ecf0a4c61 fix(lsp): rewrite incremental sync (#16252)
* use codeunits/points instead of byte ranges when applicable
* take into account different file formats when computing range and
  sending text (dos, unix, and mac supported)
* add tests of incremental sync
2021-11-09 14:37:48 -08:00
b74916cfd2 fix(lsp): convert range to byte index before highlighting (#16218)
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
2021-11-06 15:05:52 -07:00
5ad15c9fa1 fix(lsp): improve symbols_to_items performance (#16197)
* use table.insert instead of list_extend to avoid validation overhead

Co-authored-by: Gianmarco Fantinuoli <fanto-dev@hotmail.com>
2021-10-31 15:18:51 -07:00
85a8bede45 fix(lsp): default to UTF-16 when lsp client using str_utfindex 2021-10-31 14:15:56 -07:00
2e3a4747e2 fix(lsp): default to UTF-16 in make_position_params 2021-10-31 14:15:56 -07:00
cb15055c29 fix(lsp): cleanup progress messages for the correct client (#16110) 2021-10-21 09:36:27 -07:00
bd2f61c6c4 fix(lsp): fix cursor row after textEdits (#16038) 2021-10-18 11:49:33 -07:00
45fa70adcb fix(lsp): add done flag to messages returned in util.get_progress_messages() (#15985) 2021-10-10 11:41:16 -07:00
4449297d12 docs(lsp): clarify parameters of some util functions (#15851)
`pad_left` and `pad_right` are unused
List used keys of `opts` in `make_floating_popup_options`
2021-10-02 17:55:54 -07:00
b3e815094b fix(float)!: always anchor to corner of window including border #15832
N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the
window (including border). This line may also need change in this case (change
0 to -1):

This is most consistent and easiest to reason about, especially with GUIs whose
border do not need to have width/height of 1/1 in cell units.

Fix #15789
2021-10-02 17:36:24 -07:00
41cfba63cd feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)
- Fix the cursor position after applying TextEdits
- Support reversed range of TextEdit
- Invoke nvim_buf_set_text one by one
2021-09-18 13:19:21 -07:00
a5bbb932f9 refactor: move vim.lsp.diagnostic to vim.diagnostic
This generalizes diagnostic handling outside of just the scope of LSP.
LSP clients are now a specific case of a diagnostic producer, but the
diagnostic subsystem is decoupled from the LSP subsystem (or will be,
eventually).

More discussion at [1].

[1]: https://github.com/neovim/neovim/pull/15585
2021-09-15 14:09:47 -06:00
516775e9d8 fix(lsp): correctly parse LSP snippets #15579
Fixes #15522
2021-09-14 04:31:41 -07:00
f6e662bbe9 feat(lsp): get_border_size(): support repeating border char list #15474 2021-08-27 04:19:17 -07:00
c2a211b8e3 docs: make Lua docstrings consistent #15255
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.

Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
2021-08-22 13:55:28 -07:00
adebbebdd7 fix(lsp): properly handle nil lines when trimming empty lines (#15325) 2021-08-10 20:52:30 +02:00
1a10acb997 fix(lsp): floating popup should take offset_x into account when positioning (#15297) 2021-08-09 23:56:58 +02:00
a3d5f391cf docs: Add some references to LSP specification (#15321) 2021-08-09 19:45:00 +02:00
e7bde44d6d fix(lsp): prevent duplicate lines seperated by newlines (#15284) 2021-08-06 17:15:49 -04:00
c487a73fa2 feat(lsp): allow configuring zindex for floating windows (#15086) 2021-07-19 09:03:59 -07:00
d8f5f4d090 doc(lsp): various small fixes (#15113)
- remove incorrect usage of docstrings
- fix make_formatting_params return type documentation to 'DocumentFormattingParams'
- make progress_handler private
- fix links
2021-07-17 11:15:57 +02:00
9132b76da6 fix(lsp): support duplicate params in signature help (#15032) 2021-07-09 03:38:29 -07:00
af263711a3 feat(lsp): highlight active parameter in signature help (#15018) 2021-07-07 23:04:35 -07:00
910967e5af fix(lsp): prevent double <text> for cached plaintext markup 2021-07-05 00:39:46 +02:00
bdf3df4027 Fixed +1 -1 in util.lua (#14913)
No point in adding and then subtracting I believe ;)
2021-06-26 13:43:18 -04:00
e680d7d6af fix(lsp): render the last line in stylize_markdown 2021-06-25 11:45:42 -07:00
28dde1038f style(lsp): make get_markdown_fences private 2021-06-25 18:32:00 +02:00
aa1e20497a feat(lsp): use markdown_fenced_languages in stylized_markdown 2021-06-25 17:27:38 +02:00
39d9713c5b chore(lsp): removed deprecated floating preview methods 2021-06-17 07:48:40 +02:00
d7d1f40d2c fix(lsp): replace --- by a line in stylize_markdown 2021-06-15 07:35:58 +02:00
15039d7597 fix(lsp): allow 'rounded' and 'solid' in floats 2021-06-14 23:19:45 +02:00
afb0274c28 fix(lsp): convert_input_to_markdown_lines: preserve plaintext 2021-06-12 21:47:17 +02:00
f03a4d616b feat(lsp): Split out a diagnostics_to_items function from set_loclist
Makes it easier to re-use the logic to populate the quickfix list
instead of the location list.
2021-06-07 18:24:32 +02:00
4ce61742cf Merge pull request #14726 from folke/lsp_single_popup_per_buffer
fix(lsp): max 1 floating preview per buffer. Fixes #11508
2021-06-06 03:22:10 -07:00
36d05845f7 feat(lsp): extend diagnostic.set_loclist
add option to show workspace diagnostic instead of the current buffer's
2021-06-06 09:59:46 +02:00
5902bed406 docs(lsp): fix locations_to_items docstring 2021-06-05 17:22:47 -07:00
36802b895f Merge pull request #14730 from mjlbach/feature/open_loclist_on_win
fix(lsp): set_loclist should target current win
2021-06-05 17:12:55 -07:00
15abde1676 fix(lsp): set_loclist should target current win
Currently, for large number of diagnostics, the delay in populating
loclist may be sufficient for a user to switch to another window,
resulting in the loclist being populated on the wrong window.
2021-06-05 14:46:10 -07:00
149efa9b2b fix(lsp): max 1 floating preview per buffer. Fixes #11508 2021-06-05 10:13:01 +02:00
351050a10f fix(lsp): floating window border size for string type 'none' and 'shadow' 2021-06-02 20:44:13 +10:00
b10cda83fa Merge pull request #14693 from shadmansaleh/enhance/lsp/make_focusable_parameter_configurable
feat(lsp): Make focusability of lsp float configurable
2021-06-01 04:32:59 -07:00
68d48e25b6 docs(lsp): Fix opts param not captured by docgen
In the documentation for `vim.lsp.util.open_floating_preview`
the opts table keys were prefixed with `--` instead of `---`,
preventing capture by docgen.
2021-06-01 17:29:06 +06:00
0bd34cb4ec feat(lsp): Make focusability of lsp float configurable
This pr allows the user to specify whether `lsp.utils.open_floating_preview`
is focusable via the `opts` parameter. Defaults to true.

It can be configured by setting the focusable key inside opts parameter:

```lua
vim.lsp.util.open_floating_preview(contents, syntax, {focusable = false})
```
2021-06-01 17:23:35 +06:00
64bdaef327 Merge pull request #14694 from folke/lsp_popup_border 2021-06-01 01:52:38 -07:00