diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 58e5dd649c..5ab727a952 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -217,6 +217,10 @@ function! go#config#LspLog() abort return g:go_lsp_log endfunction +function! go#config#DebugLocalVariablesLoadConfig() abort + return get(g:, 'go_debug_local_variables_load_config', {'MaxStringLen': 20, 'MaxArrayValues': 20, 'MaxVariableRecurse': 10}) +endfunction + function! go#config#SetDebugDiag(value) abort let g:go_debug_diag = a:value endfunction diff --git a/autoload/go/debug.vim b/autoload/go/debug.vim index 61971f0980..3db23139ad 100644 --- a/autoload/go/debug.vim +++ b/autoload/go/debug.vim @@ -1305,7 +1305,7 @@ function! s:update_variables() abort " MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields. let l:cfg = { \ 'scope': {'GoroutineID': s:goroutineID()}, - \ 'cfg': {'MaxStringLen': 20, 'MaxArrayValues': 20, 'MaxVariableRecurse': 10} + \ 'cfg': go#config#DebugLocalVariablesLoadConfig() \ } try diff --git a/doc/vim-go.txt b/doc/vim-go.txt index ed245d61da..91ba6a72d2 100644 --- a/doc/vim-go.txt +++ b/doc/vim-go.txt @@ -2461,7 +2461,7 @@ will suppress logging entirely. Default: `'debugger,rpc'`: let g:go_debug_log_output = 'debugger,rpc' < - *'g:go_highlight_debug'* + *'g:go_highlight_debug'* Highlight the current line and breakpoints in the debugger. @@ -2469,7 +2469,7 @@ Highlight the current line and breakpoints in the debugger. let g:go_highlight_debug = 1 < - *'go:go_debug_breakpoint_sign_text'* + *'g:go_debug_breakpoint_sign_text'* Set the sign text used for breakpoints in the debugger. By default it's '>'. @@ -2477,6 +2477,20 @@ Set the sign text used for breakpoints in the debugger. By default it's '>'. let g:go_debug_breakpoint_sign_text = '>' < + *'g:go_debug_local_variables_load_config'* + +Set load configuration that is used to retrieve and display local variables in +the variable window. For details about the values, refer to +https://pkg.go.dev/github.com/go-delve/delve/service/api#LoadConfig . + +> + let g:go_debug_local_variables_load_config = { + \ 'MaxStringLen': 20, + \ 'MaxArrayValues': 20, + \ 'MaxVariableRecurse': 10, + \ } +< + ============================================================================== FAQ TROUBLESHOOTING *go-troubleshooting*