1061 Commits

Author SHA1 Message Date
Karoline Pauls 474c656659 Fix trailing characters error when connecting via tcp (#1480)
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 05:28:01 +09:00
Henrique Barcelos 36224d3955 Preserve completion doc scroll position (#1636)
* Preserve completion doc scroll position

* Preserve conceal and scroll in LSP popups

---------

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 05:19:56 +09:00
Illia Bobyr 8538ec7075 Diagnostic float: Document event handing logic (#1629)
Current event handling seems somewhat confusing.  It is good to document
the intent, in order to be able to asses if the code is doing what is
intended.

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 05:05:55 +09:00
mattn 3374cca108 Add textDocument/documentLink support (#1662)
Add :LspDocumentLink to list all document links in the quickfix list
and :LspDocumentLinkOpen to open the link on the current cursor line
in the browser or editor.
2026-04-19 04:56:48 +09:00
Mark Woods 069b6e56b3 Improve workspace symbol search performance (#1664)
Workspace symbol search is slow with many symbols because vim locations
for all symbols are calculated when generating the quickpick list, even
though they are only required when selecting a symbol to open a location

Fix by delaying calculating the vim location until a symbol is selected.

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 04:53:18 +09:00
mattn ea2de173ea fix typos (#1638) 2026-04-19 04:45:53 +09:00
mattn dd82629778 Update callbag (#1668) 2026-04-19 04:41:00 +09:00
bnnkw 1420b9b84a Skip calling complete() when there are no matches (#1667)
complete() with an empty list discards items collected from the sources
listed in the 'complete' option and closes the completion menu. Skip the
call to keep them.

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 03:49:09 +09:00
Shinya Ohyanagi 88d6d179c0 Fix invalid LSP buffer state after buffer delete or wipeout (#1663)
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-04-19 03:19:44 +09:00
mattn 0c49560e5f Add 'detail' to completionItem resolveSupport properties (#1661)
This fixes auto import for rust-analyzer >= 1.85.x. Without advertising
'detail' in resolveSupport, rust-analyzer does not generate
additionalTextEdits for auto imports.

Fixes #1595
2026-03-30 13:33:20 +09:00
mattn f38805dba9 Fix missing trailing newline in multi-change full text sync (#1659)
When multiple listener changes accumulate and the full-text fallback
path is taken, getbufline() was called directly instead of going through
lsp#utils#buffer#_get_lines(). This bypassed the fixendofline handling,
producing text without a trailing newline. The LSP server would then
return formatted text with a proper trailing newline, causing an
unwanted newline to be appended on every save.

Use _get_lines() to match every other full-text send path.

Fixes #1658
2026-03-27 10:16:57 +09:00
mattn 8b6bedec82 Add g:lsp_popup_borderchars option (#1660) 2026-03-26 18:58:20 +09:00
mattn 392657e5be Fix incorrect text sync when multiple listener changes accumulate (#1657)
When multiple listener_add callbacks fire before flush(), each change's
lnum/end references the buffer state at that point, but getbufline()
reads the final state. If a later change shifts lines, earlier changes
read wrong text.

For a single change, use the efficient listener path as before. When
multiple changes accumulate, fall back to sending full document text.

Also update s:file_content on the listener path to keep it current.

Fixes #1656
2026-03-24 12:57:41 +09:00
mattn c750165f4e Use listener_add for incremental text synchronization (#1653)
* cache getbufline and diff results per changedtick

When multiple LSP servers are registered for the same filetype,
s:text_changes() was calling getbufline(buf, 1, '$') and computing
diff once per server. For a 5000-line buffer with 3 servers, this
meant 3 full buffer reads and 3 O(n) diff loops per change event.

Cache both results keyed by changedtick so they are computed only
once regardless of the number of servers.

* use listener_add() for incremental text sync when available

When listener_add() is available (Vim 8.1.1320+), use it to track
buffer changes and build LSP contentChanges directly from the change
events. This avoids both getbufline() for the full buffer and the
O(n) diff computation in VimScript.

For a 5000-line buffer with 3 LSP servers:
- Before: 3x getbufline(5000 lines) + 3x diff loop = O(n * servers)
- After: listener gives exact change location, getbufline only for
  changed lines, result cached across servers = O(changed lines)

Falls back to existing diff-based approach when listener_add() is
not available (neovim, older Vim).

* Do not allocate list

* Extract listener/cache logic into autoload/lsp/internal/listener.vim

Move listener_add integration and buffer cache logic out of lsp.vim
into a dedicated module to keep lsp.vim changes minimal.

* Revert split send to fix Vim 8.0 on Windows

Sending the LSP header and body as separate calls caused gopls to
exit on Vim 8.0 (Windows). Send as a single payload instead.
2026-03-18 16:32:50 +09:00
mattn 02eade74a1 Add g:lsp_popup_opacity and g:lsp_popup_highlight options (#1654)
Allow users to customize popup window opacity and highlight group
across all popup types (popupmenu, floating preview, floating window).
2026-03-18 01:05:20 +09:00
mattn 0e3343e4b2 Fix CTRL-k inserting raw function call text during completion (#1655)
Use timer_start instead of feedkeys with \<C-r>= to call
on_complete_done_after. The feedkeys approach corrupts the typeahead
buffer when CTRL-k (digraph) is pressed while the popup menu is visible.
2026-03-18 00:34:54 +09:00
mattn d15fe47f6b optimize semantic highlighting performance (#1651)
- Cache line content to avoid repeated getbufline() calls during position conversion
- Use add() instead of list concatenation for building highlight lists
- Track textprop types in a dictionary instead of filtering prop_type_list() each time
2026-03-07 17:58:36 +09:00
KiYugadgeter cde54aa927 Specify the different server for hover (#1644)
* make LspHover server selectable by buffer variable

* update document

---------

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-03-07 17:40:00 +09:00
mattn f11d480362 cancel request on interrupt (#1647)
* cancel request on interrupt

* messages for cancel
2026-03-04 12:42:20 +09:00
mattn 6df6722167 Update callbag.vim (#1646) 2026-02-24 14:18:53 +09:00
mattn 0be7853a46 Add missing brace (#1645) 2026-02-09 13:47:45 +09:00
mattn 84554711aa do not check len each times (#1640) 2026-01-18 21:56:38 +09:00
Yorgos Tsitsikas 8163333b00 Fix call hierarchy handler; use extend() instead of exend() (#1637) 2026-01-13 09:47:59 +09:00
suguruwataru cdd07e0ef7 Implement insertReplaceSupport LSP capability (#1630)
`insertReplaceSupport` is a client capability that was added to
LSP in 3.16.0. It allows the client to choose, when a completion
is done, whether the completion text is to insert at the cursor,
or is to replace some text under the cursor.

Closes #1631

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-04 21:34:22 +09:00
suguruwataru 2acefda0a0 Fix wrong undo entries being added on completion on Neovim (#1633)
Closes #1632
2026-01-04 20:43:59 +09:00
ompugao 308b8c9f75 Prioritize the most severe message per line (#1579)
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-02 00:34:01 +09:00
Illia Bobyr 8a32024a15 Diagnostic float: Record position before debounce time (#1570)
It seems that we should be recording the current buffer, cursor position
and change tick before we wait to see if the float should be shown or
not.  Otherwise, if any of the above change during the
`g:lsp_diagnostics_float_delay` our recording would be incorrect.

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-02 00:14:51 +09:00
Finite State Machine 6ba341af60 Fix (in part?) prabirshrestha/vim-lsp#1612 (pop-ups × read-only files) (#1615)
#1612: "Pop-up error messages cause traceback with read-only files"
            https://github.com/prabirshrestha/vim-lsp/issues/1612

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 23:56:44 +09:00
renovate[bot] cf527525bb chore(deps): update actions/checkout action to v6 (#1619)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 23:26:51 +09:00
mityu 7bf16c486e Prefer using values() to items() (#1544)
Use values() instead of items() where dictionary keys are not used in
iteration.

Co-authored-by: Prabir Shrestha <mail@prabir.me>
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 23:23:17 +09:00
Takayuki Tsukitani c213da6bd2 add options to lsp#ui#vim#rename() to specify server (#1545)
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 23:18:49 +09:00
renovate[bot] 39bf479cfb chore(deps): update actions/setup-go action to v6 (#1613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 23:11:01 +09:00
renovate[bot] c54f6e06ae chore(deps): update actions/cache action to v5 (#1623)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-01 23:06:31 +09:00
suguruwataru 10fac72582 Stop CursorHold events from updating diagnostic floating window (#1624)
Closes #1620

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 20:09:58 +09:00
thinca 09ea5b55bb Add end pos for qf and loclist (#1627)
* Fix the structure of test response

* Add end positions for quickfix/loclist

* Add a function to make loc_range

---------

Co-authored-by: mattn <mattn.jp@gmail.com>
2026-01-01 01:27:43 +09:00
thinca 7484060435 Remove debug log (#1628) 2026-01-01 00:15:53 +09:00
Satoru Kitaguchi cb3406a591 Add support for range diagnostics under cursor (#1586) 2025-11-16 17:17:24 +09:00
mattn c0de72708a make lsp#ensure_flush_all public for delaying initialize (#1618) 2025-11-03 09:48:56 +09:00
Shinya Ohyanagi 04ef607075 Fix completion item text selection priority (#1614)
* Fix completion item text selection priority

According to the Language Server Protocol 3.17 specification:

- filterText is only used for filtering and sorting completion items
- When textEdit is provided, insertText must be ignored

* Fix filtering should be performed on filterText

If `filterText` exists, the filtering target has been changed from `word`.

The filter is defined as follows in the LSP specification:

```
A string that should be used when filtering a set of completion items.
When omitted the label is used as the filter text for this item.
```

* Fix remove unnecessary empty check condition

---------

Co-authored-by: mattn <mattn.jp@gmail.com>
2025-10-06 21:53:27 +09:00
mattn be06c95281 append .0 to libgmodule.so on LD_PRELOAD (#1616) 2025-10-01 10:13:03 +09:00
Jorenar 04428c9200 Improve checking for 'completionProvider' (#1574) 2024-09-22 16:16:10 -07:00
hrsh7th 356254d638 Update vital-vs for fixing to scroll bordererd-window (#1556)
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2024-08-04 19:08:44 -07:00
Jorenar 396d248528 Add missing borders to Neovim's floating windows (#1565)
Brings behaviour closer to Vim
2024-08-04 17:00:36 -07:00
Rodrigo Goya 6b7aabde99 Add check for server entry in buffer entry. (#1548) 2024-07-19 22:59:14 -07:00
Thomas Bruyelle e05c42fbf0 fix(text_edit): discarded change from the initial buffer (#1552)
* fix(text_edit): discarded change from the initial buffer

When multiple calls to apply_text_edits, the changes made to the current
buffer are discarded if the following text_edit concerns a file that
is not in the buffer list.

The problem comes from the _switch function, which executes `edit!` when
it detects that the target is not in the buffer list. If a change was
made to the current buffer before that, that change is discarded
(definition of `edit!`).

The fix consists of a different logic: when _switch detects that the
target is not in the buffer list, it calls `badd` prior to switching to
the buffer that has just been added. No more `edit!`, no more discarded
changes.

The added test fails without the patch in the _switch function.

* use better way to have a named buffer
2024-07-19 22:56:11 -07:00
YunmingChan 0094b5e0fc fix typo in doc (#1561) 2024-07-19 22:55:03 -07:00
pocari 445c20708a check deprecated function (#1562) 2024-07-19 22:53:41 -07:00
Prabir Shrestha 2e03278605 Revert "Switch to the new Neovim health API, since the old report_health func…" (#1569)
This reverts commit f160fe2719.
2024-07-19 22:53:30 -07:00
Oisín f160fe2719 Switch to the new Neovim health API, since the old report_health functions are deprecated and break :checkhealth in recent versions of neovim (#1567) 2024-07-19 22:40:10 -07:00
Kebin Liu a8f244a4e9 Add document for server_info.env (#1559)
* Add document for server_info.env

* Fix format

* Remove action cache to avoid random fails
2024-06-20 16:36:17 -07:00