Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: make local variables load config configurable #3676

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion autoload/go/debug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,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
Expand Down
18 changes: 16 additions & 2 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2481,22 +2481,36 @@ 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.

>
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 '>'.

>
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*

Expand Down