To Watch Variables and Expressions while Debugging an LSP File (AutoLISP/VS Code)

  1. In Visual Studio Code, start debugging an AutoLISP source (LSP) file.
  2. On the Activity Bar, click Debug and Run (or click View menu > Debug).
  3. In the editor window containing the LSP file, select the variable or expression to watch.
  4. Right-click and choose Debug: Add to Watch to add the selected variable or expression to the Watch section of the Debug and Run view.


    Note: Right-click a variable or expression in the Watch section of the Debug and Run view, and choose Remove Expression to stop watching that item.

You can watch the value of the most recently evaluated expression by adding the *last-value* variable to the Watch section. For more information on how to add the *last-value* variable, see To View the Return Value of the Most Recent Expression Evaluated.