From 61897f12db53e359b53354423155caecba03ead6 Mon Sep 17 00:00:00 2001 From: Daniel Morris Date: Sun, 12 Aug 2018 21:24:03 -0500 Subject: [PATCH] Add code for node inspect --- README.md | 4 -- autoload/vebugger/ninspect.vim | 10 ++++- doc/tags | 68 ++++++++++++++++++++++++++++++++++ doc/vebugger.txt | 1 + 4 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 doc/tags diff --git a/README.md b/README.md index 09dd42e..955608c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -NOTE: I forked to add node.js support for node 8 and later -currently the debugger stops at the first line. I'll fix this eventually. and then see if I can get this merged back into the original - - INTRODUCTION ============ Screencast - https://vimeo.com/95775461 diff --git a/autoload/vebugger/ninspect.vim b/autoload/vebugger/ninspect.vim index ce90e73..1a748c2 100644 --- a/autoload/vebugger/ninspect.vim +++ b/autoload/vebugger/ninspect.vim @@ -152,9 +152,15 @@ endfunction function! vebugger#ninspect#_requestEvaluateExpression(writeAction,debugger) for l:evalAction in a:writeAction - call a:debugger.std_addLineToShellBuffer('Eval: '.l:evalAction.expression) + if get(g:,'vebugger_ninspect_eval_out_to_console', 0) + call a:debugger.std_addLineToShellBuffer('Eval: '.l:evalAction.expression) + endif "call a:debugger.writeLine('exec console.log(JSON.stringify('.l:evalAction.expression.', null, 2))') - call a:debugger.writeLine('exec (function(){var glbCacheForEval123abf = [];let ret = JSON.stringify('.l:evalAction.expression.', function(key,value){if(typeof value===''object''&&value!==null){if(glbCacheForEval123abf.indexOf(value)!==-1){try{return JSON.parse(JSON.stringify(value))}catch(error){return}}glbCacheForEval123abf.push(value)}return value}, 2);console.log(ret);return ret;})()') + if get(g:,'vebugger_ninspect_eval_out_to_console', 0) + call a:debugger.writeLine('exec (function(){var glbCacheForEval123abf = [];let ret = JSON.stringify('.l:evalAction.expression.', function(key,value){if(typeof value===''object''&&value!==null){if(glbCacheForEval123abf.indexOf(value)!==-1){try{return JSON.parse(JSON.stringify(value))}catch(error){return}}glbCacheForEval123abf.push(value)}return value}, 2);console.log(ret);return ret;})()') + else + call a:debugger.writeLine('exec (function(){var glbCacheForEval123abf = [];let ret = JSON.stringify('.l:evalAction.expression.', function(key,value){if(typeof value===''object''&&value!==null){if(glbCacheForEval123abf.indexOf(value)!==-1){try{return JSON.parse(JSON.stringify(value))}catch(error){return}}glbCacheForEval123abf.push(value)}return value}, 2);return ret;})()') + endif "call a:debugger.writeLine('exec JSON.stringify('.l:evalAction.expression.', null, 2)') let s:programEvalMode=1 let s:programEvalModeExpression=''.l:evalAction.expression diff --git a/doc/tags b/doc/tags new file mode 100644 index 0000000..12c8533 --- /dev/null +++ b/doc/tags @@ -0,0 +1,68 @@ +:VBGclearBreakpints vebugger.txt /*:VBGclearBreakpints* +:VBGcontinue vebugger.txt /*:VBGcontinue* +:VBGeval vebugger.txt /*:VBGeval* +:VBGevalSelectedText vebugger.txt /*:VBGevalSelectedText* +:VBGevalWordUnderCursor vebugger.txt /*:VBGevalWordUnderCursor* +:VBGexecute vebugger.txt /*:VBGexecute* +:VBGexecuteSelectedText vebugger.txt /*:VBGexecuteSelectedText* +:VBGkill vebugger.txt /*:VBGkill* +:VBGrawWrite vebugger.txt /*:VBGrawWrite* +:VBGrawWriteSelectedText vebugger.txt /*:VBGrawWriteSelectedText* +:VBGstepIn vebugger.txt /*:VBGstepIn* +:VBGstepOut vebugger.txt /*:VBGstepOut* +:VBGstepOver vebugger.txt /*:VBGstepOver* +:VBGtoggleBreakpoint vebugger.txt /*:VBGtoggleBreakpoint* +:VBGtoggleBreakpointThisLine vebugger.txt /*:VBGtoggleBreakpointThisLine* +:VBGtoggleTerminalBuffer vebugger.txt /*:VBGtoggleTerminalBuffer* +VBGattachGDB vebugger.txt /*VBGattachGDB* +VBGstartGDB vebugger.txt /*VBGstartGDB* +VBGstartGDBForD vebugger.txt /*VBGstartGDBForD* +VBGstartPDB vebugger.txt /*VBGstartPDB* +VBGstartRDebug vebugger.txt /*VBGstartRDebug* +VBGstartRDebug vebugger.txt /*VBGstartRDebug* +g:vebugger_leader vebugger.txt /*g:vebugger_leader* +g:vebugger_path_gdb vebugger.txt /*g:vebugger_path_gdb* +g:vebugger_path_jdb vebugger.txt /*g:vebugger_path_jdb* +g:vebugger_path_mdbg vebugger.txt /*g:vebugger_path_mdbg* +g:vebugger_path_mdbg_32 vebugger.txt /*g:vebugger_path_mdbg_32* +g:vebugger_path_mdbg_64 vebugger.txt /*g:vebugger_path_mdbg_64* +g:vebugger_path_node vebugger.txt /*g:vebugger_path_node* +g:vebugger_path_python vebugger.txt /*g:vebugger_path_python* +g:vebugger_path_python_2 vebugger.txt /*g:vebugger_path_python_2* +g:vebugger_path_python_3 vebugger.txt /*g:vebugger_path_python_3* +g:vebugger_path_ruby vebugger.txt /*g:vebugger_path_ruby* +vebugger vebugger.txt /*vebugger* +vebugger#gdb#start vebugger.txt /*vebugger#gdb#start* +vebugger#jdb#start vebugger.txt /*vebugger#jdb#start* +vebugger#mdbg#searchAndAttach vebugger.txt /*vebugger#mdbg#searchAndAttach* +vebugger#mdbg#start vebugger.txt /*vebugger#mdbg#start* +vebugger#ninspect#start vebugger.txt /*vebugger#ninspect#start* +vebugger#pdb#start vebugger.txt /*vebugger#pdb#start* +vebugger#rdebug#start vebugger.txt /*vebugger#rdebug#start* +vebugger-architecture vebugger.txt /*vebugger-architecture* +vebugger-architecture-close-handlers vebugger.txt /*vebugger-architecture-close-handlers* +vebugger-architecture-debugger-state vebugger.txt /*vebugger-architecture-debugger-state* +vebugger-architecture-read-handlers vebugger.txt /*vebugger-architecture-read-handlers* +vebugger-architecture-read-result-objects vebugger.txt /*vebugger-architecture-read-result-objects* +vebugger-architecture-think-handlers vebugger.txt /*vebugger-architecture-think-handlers* +vebugger-architecture-write-actions-objects vebugger.txt /*vebugger-architecture-write-actions-objects* +vebugger-architecture-write-handlers vebugger.txt /*vebugger-architecture-write-handlers* +vebugger-breakpoints vebugger.txt /*vebugger-breakpoints* +vebugger-commands vebugger.txt /*vebugger-commands* +vebugger-configuration vebugger.txt /*vebugger-configuration* +vebugger-evalutate vebugger.txt /*vebugger-evalutate* +vebugger-execute vebugger.txt /*vebugger-execute* +vebugger-execution-control vebugger.txt /*vebugger-execution-control* +vebugger-gdb vebugger.txt /*vebugger-gdb* +vebugger-jdb vebugger.txt /*vebugger-jdb* +vebugger-keymaps vebugger.txt /*vebugger-keymaps* +vebugger-launching vebugger.txt /*vebugger-launching* +vebugger-mdbg vebugger.txt /*vebugger-mdbg* +vebugger-ninspect vebugger.txt /*vebugger-ninspect* +vebugger-open-the-hood vebugger.txt /*vebugger-open-the-hood* +vebugger-pdb vebugger.txt /*vebugger-pdb* +vebugger-rdebug vebugger.txt /*vebugger-rdebug* +vebugger-requirements vebugger.txt /*vebugger-requirements* +vebugger-terminate vebugger.txt /*vebugger-terminate* +vebugger-usage vebugger.txt /*vebugger-usage* +vebugger.txt vebugger.txt /*vebugger.txt* diff --git a/doc/vebugger.txt b/doc/vebugger.txt index 46b5218..3304e14 100644 --- a/doc/vebugger.txt +++ b/doc/vebugger.txt @@ -24,6 +24,7 @@ interactive shell debugger, and comes with implementations for: * Mdbg - a .NET debugger(Windows only) * PDB - a Python module for debugging Python scripts * RDebug - a Ruby command line option for debugging Ruby scripts +* NInspect - Node inspect is a node js 8+ command line debugger Other implementations can be added with ease, and I will accept pull requests that add such implementations as long as they use Vim's |license|.