Commit Graph

32640 Commits

Author SHA1 Message Date
52a4bc4548 docs: lsp, emoji, startup #33446
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-04-27 13:40:46 -07:00
a6591950f6 fix(shada): don't store search and sub patterns if /0 in 'shada' 2025-04-27 22:14:10 +02:00
71455173b4 feat(shada): don't store jumplist if '0 in 'shada' 2025-04-27 22:14:09 +02:00
82b844fefe fix(lsp): fallback to empty capability_path in supports_registration 2025-04-27 18:49:50 +01:00
181df60533 fix(lsp): remove unused ns field 2025-04-27 18:49:50 +01:00
63323a9c81 feat(checkhealth): trigger FileType event after showing report #33677
Problem:
`FileType` event is fired before checkhealth report is finished, so
user can't override report settings or contents.
https://github.com/neovim/neovim/pull/33172#issuecomment-2833513916

Solution:
- Trigger FileType event later.
- Document how to remove emojis.
2025-04-27 10:32:25 -07:00
b98aefc584 fix(lsp): properly handle documentColor from multiple servers #33656 2025-04-27 16:58:10 +00:00
ef16a02a76 test: feed_command is deprecated #33674 2025-04-27 09:46:53 -07:00
e991133058 fix: remove unnecessary nvim -l from gen command #33676 2025-04-27 09:46:19 -07:00
86b34ad073 docs: provide example_init.lua #33524
Problem:
There are some "boilerplate" steps for new users. Although we are
constantly improving defaults and lifting patterns into core, users
eventually want to know how to start their own config, add plugins, etc.

Solution:
Add `runtime/example_init.lua` and refer to it from docs.
2025-04-27 08:11:02 -07:00
a167800f1c vim-patch:partial:fbe4a8f: runtime(doc): Fix notation of "Vim script" and "Vim9 script" (#33673)
closes: vim/vim#17213

fbe4a8f5c0

Cherry-pick Test_source_ignore_shebang() change from patch 9.0.0363.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-04-27 22:06:16 +08:00
923efaea28 fix(runtime): cpoptions is reset in Lua file #33671
closes #33670
2025-04-27 04:55:15 -07:00
c2fc867843 Merge #33660 from MariaSolOs/supports-dynamic 2025-04-27 04:34:05 -07:00
31e31273bc vim-patch:9.1.1344: double free in f_complete_match() (after v9.1.1341)
Problem:  double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
          regmatch.regprog and before_cursor in the error case

closes: https://github.com/vim/vim/pull/17203

3accf046ec

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:57:11 +08:00
fcabbc2283 vim-patch:9.1.1341: cannot define completion triggers
Problem:  Cannot define completion triggers and act upon it
Solution: add the new option 'isexpand' and add the complete_match()
          function to return the completion matches according to the
          'isexpand' setting (glepnir)

Currently, completion trigger position is determined solely by the
'iskeyword' pattern (\k\+$), which causes issues when users need
different completion behaviors - such as triggering after '/' for
comments or '.' for methods. Modifying 'iskeyword' to include these
characters has undesirable side effects on other Vim functionality that
relies on keyword definitions.

Introduce a new buffer-local option 'isexpand' that allows specifying
different completion triggers and add the complete_match() function that
finds the appropriate start column for completion based on these
triggers, scanning backwards from cursor position.

This separation of concerns allows customized completion behavior
without affecting iskeyword-dependent features. The option's
buffer-local nature enables per-filetype completion triggers.

closes: vim/vim#16716

bcd5995b40

Co-authored-by: glepnir <glephunter@gmail.com>
2025-04-27 15:00:31 +08:00
d6fffe6b32 fix(lsp): access correct client capability path in supports_registration 2025-04-26 18:40:55 -07:00
66339e0641 feat(lsp): generate method to client capability map 2025-04-26 18:24:39 -07:00
c1d21492a6 vim-patch:c29b533: runtime(vim): Update base-syntax, match continued strings and tail comments (#33659)
Continued strings are currently only matched after operators, in
parenthesised expressions and in function call argument lists.

closes: vim/vim#14975

c29b533cf1

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-27 01:17:39 +00:00
2c3488c52e vim-patch:c5cb6b2: runtime(doc): tagfunc should refer to 'complete' option (#33658)
fixes: vim/vim#17205

c5cb6b2ee4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-27 01:06:08 +00:00
1999c4cdc1 fix: screenchar()/screenstring() with multigrid #32494
Problem:
- When multigrid is enabled, screenchar()/screenstring() functions return wrong
  results. See https://github.com/neovide/neovide/issues/2569
- `screenstring()` executed via RPC in child Nvim process, doesn't recognize
  floating windows.

Solution:
In ui_comp_get_grid_at_coord(), also iterate window grids.
2025-04-26 13:39:12 -07:00
dd18ab1691 test: drop redundant clear() #33654
followup to #33647 after overlapping merge
2025-04-26 09:42:13 -07:00
e7410048fa test: drop redundant clear() #33647
Problem:
Tests call `clear()` even though `clear_notrace()` is already called in
a `before_each()` handler, wasting precious milliseconds!

Solution:
Remove redundant `clear()` calls.
2025-04-26 09:39:32 -07:00
d927a87ed6 fix(health): checkhealth float opens extra empty buffer #33648 2025-04-26 09:10:06 -07:00
f486f1742e perf(lsp): include previousResultId in DocumentDiagnosticParams #32887
Problem:
Users of the Roslyn (C#) LSP have encountered significant delays when
retrieving pull diagnostics in large documents while using Neovim. For
instance, diagnostics in a 2000-line .cs file can take over 20 seconds
to display after edits in Neovim, whereas in VS Code, diagnostics for
the same file are displayed almost instantly.

As [mparq noted](https://github.com/seblj/roslyn.nvim/issues/93#issuecomment-2508940330)
in https://github.com/seblj/roslyn.nvim/issues/93, VS Code leverages
additional parameters specified in the [LSP documentation for
textDocument/diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#documentDiagnosticParams),
specifically:

- previousResultId
- identifier

Solution:
When requesting diagnostics, Neovim should include the
`previousResultId` and `identifier` parameters as part of the request.
These parameters enable the server to utilize caching and return
incremental results.

Support for maintaining state is already present in the
[textDocument/semanticTokens implementation](8f84167c30/runtime/lua/vim/lsp/semantic_tokens.lua (L289)).
A similar mechanism can be implemented in `textDocument/diagnostic` handler.
2025-04-26 09:09:20 -07:00
8315697449 fix(lsp): detect if Client:request resolved synchronously #33624
Problem:
In cases when the (in-process) LSP server responds to the request
immediately and calls `notify_reply_callback` the request will still be
marked as pending, because the code assumes that the response will occur
asynchronously. Then the request will be pending forever, because it was
already set as "completed" before we even set it as "pending".

A workaround is to wrap `notify_replay_callback` in `vim.shedule` ([like
so](https://github.com/neovim/neovim/pull/24338#issuecomment-2809568617)]
but that seems counterintuitive.

Solution:
Handle this case in Client:request().
2025-04-26 07:08:03 -07:00
e45ec5a852 Merge #33642 from ofseed/lsp-fix-signature 2025-04-26 06:30:23 -07:00
e324ab2b6b vim-patch:35cfc3d: runtime(debversions): Add questing (25.10) as Ubuntu release name
closes: vim/vim#17201

35cfc3d3c4

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-04-26 10:43:12 +02:00
342974773c fix(lsp): cycling signatures with the default config.focusable 2025-04-26 16:12:25 +08:00
9e93bfdb5f fix(lsp): prioritize showing active signature 2025-04-26 15:44:30 +08:00
8090dcf494 test(pum): check RightRelease in outside pum with winbar (#33640) 2025-04-26 09:44:21 +08:00
766cd01ff2 vim-patch:9.1.1346: missing out-of-memory check in textformat.c (#33639)
Problem:  missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
          internal_format() and same_leader() (John Marriott)

closes: vim/vim#17200

c25368ba14

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-04-26 07:42:24 +08:00
d01b2611a6 fix(ui): exclude unfocusable windows from 'complete' "w" completion
Problem:  As in f85bc41, assume unfocusable windows to be UI windows
          whose buffer content is unexpectedly included in 'complete'
          "w" completion.
Solution: Exclude unfocusable windows when looping over windows.
2025-04-25 17:45:57 +02:00
d9353bd442 test(pum): fix passing incorrect grid (#33635) 2025-04-25 22:51:25 +08:00
06613989a6 build(deps): bump libuv to v1.51.0 2025-04-25 13:01:29 +02:00
1fed4412e4 vim-patch:e36a931: runtime(groff,nroff): improve ftplugin
- set options in ftplugin but not in syntax
- implement ftplugin/groff.vim (wrapper of ftplugin/nroff.vim)

closes: vim/vim#17174

e36a931d9b

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-25 10:58:49 +02:00
9e450000d3 vim-patch:32f4973: runtime(gleam): update filetype plugin, include new compiler and syntax script
closes: vim/vim#17172

32f49738d1

Co-authored-by: Kirill Morozov <mail2kirill@gmail.com>
2025-04-25 10:58:49 +02:00
4ddd31de14 vim-patch:9.1.1343: filetype: IPython files are not recognized
Problem:  filetype: IPython files are not recognized
          (user202729)
Solution: detect *.ipy files as python filetype

fixes: vim/vim#17163

e380b5cbba

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-25 10:35:32 +02:00
533ce0e807 test(pum): remove two more duplicate screen states (#33628) 2025-04-25 15:19:09 +08:00
7d569abb20 fix(pum): handle RightDrag on parent grid properly (#33626) 2025-04-25 06:37:42 +00:00
1670fbee0f fix(docs) fix syntax error in Lua snippet for vim.lsp.document_color #33612
9ff1239634 added support for 'textDocument/documentColor' but the
text snippet in the Lua docs seem to contain a syntax error.
2025-04-24 19:21:23 +00:00
276860b538 fix(messages): clear 'showmode' message after insert_expand #33607
Problem:  'showmode' ext_messages state is not cleared after insert_expand mode.
Solution: Replace empty message with more idiomatic way to clear the showmode.
2025-04-24 12:11:49 -07:00
18e8839c80 fix(lsp): don't create an 'LspAttach' document_color autocommand 2025-04-24 21:03:44 +02:00
8495d96238 fix(lsp): ensure bufstate when calling vim.lsp.document_color.is_enabled 2025-04-24 21:03:44 +02:00
9ff1239634 feat(lsp): support textDocument/documentColor
test(lsp): add tests form `vim.lsp.document_color`
2025-04-24 18:48:19 +02:00
ca47cc39f8 refactor(lsp): add handler to vim.lsp.util._refresh options 2025-04-24 18:48:19 +02:00
ac8ae1596c vim-patch:9.1.1340: cannot complete :filetype arguments (#33602)
Problem:  cannot complete :filetype arguments (Phạm Bình An)
Solution: add :filetype ex command completion, add "filetypecmd"
          completion type for getcompletion()

fixes: vim/vim#17165
closes: vim/vim#17167

a3422aa317

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-04-24 00:50:33 +00:00
63689deb45 vim-patch:9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer (#33600)
Problem:  Undo corrupted with 'completeopt' "preinsert" when switching
          buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
          (zeertzjq)

related: neovim/neovim#33581
closes: vim/vim#17193

1343681aba
2025-04-24 07:35:11 +08:00
921752d3e2 Merge pull request #33565 from zeertzjq/vim-9.1.1329
vim-patch:9.1.{1329,1331,1338}
2025-04-24 07:34:37 +08:00
3d126ec89f vim-patch:9.1.1338: Calling expand() interferes with cmdcomplete_info()
Problem:  Calling expand() interferes with cmdcomplete_info()
          (after 9.1.1329).
Solution: Only clear cmdline_orig when starting/ending cmdline mode
          (zeertzjq).

closes: vim/vim#17192

ec270a5f55
2025-04-24 06:53:26 +08:00
07d60e8f19 vim-patch:9.1.1331: Leaking memory with cmdcomplete()
Problem:  Leaking memory with cmdcomplete()
          (zeertzjq, after v9.1.1329)
Solution: free the memory (Girish Palya)

closes: vim/vim#17190

5c3d1e3258

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-04-24 06:53:26 +08:00