Compare commits

...

2 Commits

Author SHA1 Message Date
zeertzjq
6a330f893b fix(lua): report error in Lua Funcref callback properly (#35555) 2025-08-31 06:44:23 +08:00
glepnir
1b3abfa688 docs(lsp): mention lsp/after/ in faq #35534 2025-08-30 10:31:16 -07:00
3 changed files with 11 additions and 2 deletions

View File

@@ -162,7 +162,7 @@ order of increasing priority:
1. Configuration defined for the `'*'` name.
2. Configuration from the result of merging all tables returned by
`lsp/<name>.lua` files in 'runtimepath' for a server of name `name`.
`lsp/<config>.lua` files in 'runtimepath' for the config named `<config>`.
3. Configurations defined anywhere else.
Example: given the following configs... >lua
@@ -280,6 +280,12 @@ FAQ *lsp-faq*
" (async = false is the default for format)
autocmd BufWritePre *.rs lua vim.lsp.buf.format({ async = false })
<
- Q: How to avoid my own lsp/ folder being overridden?
- A: Place your configs under "after/lsp/". Files in "after/lsp/" are loaded
after those in "nvim/lsp/", so your settings will take precedence over
the defaults provided by nvim-lspconfig. See also: |after-directory|
*lsp-vs-treesitter*
- Q: How do LSP, Treesitter and Ctags compare?
- A: LSP requires a client and language server. The language server uses

View File

@@ -1496,7 +1496,7 @@ int typval_exec_lua_callable(LuaRef lua_cb, int argcount, typval_T *argvars, typ
PUSH_ALL_TYPVALS(lstate, argvars, argcount, false);
if (nlua_pcall(lstate, argcount, 1)) {
nlua_print(lstate);
nlua_error(lstate, _("Lua callback: %.*s"));
return FCERR_OTHER;
}

View File

@@ -16,6 +16,7 @@ local feed = n.feed
local assert_alive = n.assert_alive
local NIL = vim.NIL
local eq = t.eq
local matches = t.matches
before_each(clear)
@@ -289,6 +290,8 @@ describe('luaeval()', function()
return true
]]
)
-- v:errmsg is set properly #35554
matches(': dead function\n', api.nvim_get_vvar('errmsg'))
end)
it('should handle passing functions around', function()