-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Handlers of LSP requests like textDocument/definition
, textDocument/declaration
etc open other files content in a new buffer, using sequence of bufadd
and bufload
functions. In some cases, still not sure about the exact cause, this way created buffers do not trigger autocommands assigned to their particular filetype. This applies for example to gopls
Go language server.
Handlers for above mentioned requests use auxiliary function GotoSymbolLoc which through DecodeLocation first creates a new buffer with LspUriToBufnr, next loads its content with bufload
in DecodePosition as part of the call chain. The latter effectively prevents filetype plugin code to be executed. If commented out, entering the target buffer is enough to load its contents and trigger filetype related code.
It may also be a bug in Vim, still unclear.
Vim version: 9.1.1734