Skip to content

lsp initialization#9

Merged
sigfriedCub1990 merged 5 commits into
mainfrom
lsp-initialization
Mar 3, 2026
Merged

lsp initialization#9
sigfriedCub1990 merged 5 commits into
mainfrom
lsp-initialization

Conversation

@sigfriedCub1990
Copy link
Copy Markdown
Owner

  • refactor: extract common buffer load/cleanup logic into utils.with_buf
  • fix: suppress file path echo when jumping to fixture definition
  • fix: suppress file info message when jumping to a file
  • fix: use vim.fn.execute() to suppress file info on jump
  • fix: suppress file info message printed by bufload during scanning

Suppress autocommands during temporary buffer loads to prevent LSP
clients from attaching to every scanned file. Extract the repeated
pattern (bufadd, bufload, filetype set, cleanup) from ts.lua, usages.lua,
and rename.lua into a shared utils.with_buf() helper.
':edit' prints the file info message (path, line count, bytes) on every
jump. Use ':silent edit' to suppress it.
':silent edit' only suppresses Vimscript-level messages. Neovim's file
info message ("file.py" 42L, 1234B) is printed by Neovim's internals
and is controlled by the 'F' flag in 'shortmess'. Temporarily append it
around ':edit' and restore the original value afterward.
Both ':silent edit' and temporarily setting shortmess+=F failed because
Neovim's C-level fileinfo message can be displayed after the Lua frame
completes, by which point shortmess has been restored and :silent no
longer applies.

vim.fn.execute() is backed by :redir, which captures all output at the
channel level before it reaches the command line. This gives reliable
suppression regardless of message timing. Also adds fnameescape() for
correct handling of paths with special characters.
eventignore = 'all' only suppresses autocommands. It does not suppress
the C-level file-reading message ('path/to/file' NL, NB) that
bufload() emits via open_buffer() → readfile(). Wrap the bufload call
in vim.fn.execute() which uses :redir internally to capture all output
at the channel level before it reaches the command line.
@sigfriedCub1990 sigfriedCub1990 self-assigned this Mar 3, 2026
@sigfriedCub1990 sigfriedCub1990 merged commit 90bb791 into main Mar 3, 2026
2 checks passed
@sigfriedCub1990 sigfriedCub1990 deleted the lsp-initialization branch March 3, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant