mirror of
https://github.com/neovim/neovim.git
synced 2025-11-03 09:14:24 +00:00
vim-patch:9.1.0984: exception handling can be improved
Problem: exception handling can be improved
Solution: add v:stacktrace and getstacktrace()
closes: vim/vim#16360
663d18d610
Co-authored-by: ichizok <gclient.gaap@gmail.com>
Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
This commit is contained in:
14
runtime/lua/vim/_meta/vimfn.lua
generated
14
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -3770,6 +3770,20 @@ function vim.fn.getregtype(regname) end
|
||||
--- @return vim.fn.getscriptinfo.ret[]
|
||||
function vim.fn.getscriptinfo(opts) end
|
||||
|
||||
--- Returns the current stack trace of Vim scripts.
|
||||
--- Stack trace is a |List|, of which each item is a |Dictionary|
|
||||
--- with the following items:
|
||||
--- funcref The funcref if the stack is at the function,
|
||||
--- otherwise this item is not exist.
|
||||
--- event The string of the event description if the
|
||||
--- stack is at autocmd event, otherwise this item
|
||||
--- is not exist.
|
||||
--- lnum The line number of the script on the stack.
|
||||
--- filepath The file path of the script on the stack.
|
||||
---
|
||||
--- @return table[]
|
||||
function vim.fn.getstacktrace() end
|
||||
|
||||
--- If {tabnr} is not specified, then information about all the
|
||||
--- tab pages is returned as a |List|. Each List item is a
|
||||
--- |Dictionary|. Otherwise, {tabnr} specifies the tab page
|
||||
|
||||
12
runtime/lua/vim/_meta/vvars.lua
generated
12
runtime/lua/vim/_meta/vvars.lua
generated
@@ -203,7 +203,8 @@ vim.v.errors = ...
|
||||
vim.v.event = ...
|
||||
|
||||
--- The value of the exception most recently caught and not
|
||||
--- finished. See also `v:throwpoint` and `throw-variables`.
|
||||
--- finished. See also `v:stacktrace`, `v:throwpoint`, and
|
||||
--- `throw-variables`.
|
||||
--- Example:
|
||||
---
|
||||
--- ```vim
|
||||
@@ -616,6 +617,13 @@ vim.v.servername = ...
|
||||
--- @type integer
|
||||
vim.v.shell_error = ...
|
||||
|
||||
--- The stack trace of the exception most recently caught and
|
||||
--- not finished. Refer to `getstacktrace()` for the structure of
|
||||
--- stack trace. See also `v:exception`, `v:throwpoint`, and
|
||||
--- `throw-variables`.
|
||||
--- @type table[]
|
||||
vim.v.stacktrace = ...
|
||||
|
||||
--- Last given status message.
|
||||
--- Modifiable (can be set).
|
||||
--- @type string
|
||||
@@ -718,7 +726,7 @@ vim.v.this_session = ...
|
||||
|
||||
--- The point where the exception most recently caught and not
|
||||
--- finished was thrown. Not set when commands are typed. See
|
||||
--- also `v:exception` and `throw-variables`.
|
||||
--- also `v:exception`, `v:stacktrace`, and `throw-variables`.
|
||||
--- Example:
|
||||
---
|
||||
--- ```vim
|
||||
|
||||
Reference in New Issue
Block a user