(Crossposting these tips as they seem equally relevant here...)

Without diminishing the importance of better "out of the box" tooling for Nim, 
here are some tricks that have improved my experience a lot:

  * This plugin for VSCode allowed me to make a "Step Over" command that works 
like you'd expect it to -- even when there are Nim template/macros involved:



<https://marketplace.visualstudio.com/items?itemName=geddski.macros>
    
    
      "macros": {
        "runToNextLine": [
            "editor.debug.action.toggleBreakpoint",
            "cursorDown",
            "editor.debug.action.toggleBreakpoint",
            "workbench.action.debug.continue",
        ]
      }
    
    
    Run

It's not perfect, but helps me grok code by walking its execution path, without 
the distraction of constantly jumping into library code.

  * Here are links I'd found useful for getting demangling in the VSCode 
debugger:



<https://github.com/saem/vscode-nim/issues/59> 
<https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/>

IMPORTANT: These currently only work when using the (soon-to-be-legacy) 
--mm:refc memory manager.

It's certainly not ideal that the best debugging experience is obtained by 
copy-pasting some python code from Reddit. FWIW, there's no fundamental reason 
why this can't all be more streamlined with some updates to the VSCode plugin 
for Nim. 

Reply via email to