How to debug the extension?

HBuilderX 3.2.11+, supports debugging extensions.

Start debugging

In the left view, select the extension to be debugged, and click the run icon in the toolbar to open the run debug list.

How to debug the extension? - 图1

Click [Debug Extension] to open Debug View

About node-debug extension

HBuilderX extension development relies on the node-debug extension. If the pop-up window prompts to install the [node-debug] extension during debugging, be sure to click install, otherwise the extension cannot be debugged.

How to debug the extension? - 图2

Breakpoints

Open the file to be debugged, and right-click on the line number.

How to debug the extension? - 图3

Debug View @DebugView

After start debugging, you can see the debugging view in the left view of HBuilderX, as follows:

5 parts of debug view:

  • Debug Toolbar
  • Variables (Copy valueCopy expressionAdd to watch)
  • Watchs(including add/edit/delete expressions, and copy values
  • Call stack
  • breakpoints(including delete/start/disable breakpoint)

How to debug the extension? - 图4

Debug Actions @DebugActions

How to debug the extension? - 图5

  • Continue F8
  • Next step F10
  • Enter F11
  • Return Shift+F11

Continue @Continue

Continue (F8):After clicking, run until the next breakpoint.

How to debug the extension? - 图6

Data check and view variables

Add to watch

In the [Variable Window], select the variable and right-click the menu to add the variable to the watch window.

How to debug the extension? - 图7

Hover show

During breakpoint debugging, hover the mouse over the variable to be viewed to open the hover window.

How to debug the extension? - 图8