Skip to content

Add Tarantool debugging facilities #26

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

georgiy-belyanin
Copy link
Member

This patch introduces basic Tarantool debugging facilities into the
extension. Basically it is done using EmmyLuaDebugger [^1].

Set up the debugger using the following instructions.

  • Insert debugger code in Tarantool application by pressing
    Ctrl+Shift+P (or Cmd+Shift+P on MacOS) and running Tarantool: Insert debugger code command.
  • Start single Tarantool instance.
  • Press F5 or run Debug: Start debugging command by pressing
    Ctrl+Shift+P (or Cmd+Shift+P on MacOS).
  • Choose EmmyLua New Debugger in the list. This debugging
    configuration would run automatically from now.
  • Set up breakpoints & access the Tarantool instance through Debug console in the bottom panel.

These features are supported.

  • Breakpoints.
  • Step-by-step execution within the fiber.
  • Multiple files support.
  • Interacting with the local variables, console at the debug mode.

Needs EmmyLua/EmmyLuaDebugger#75 to be tested
on MacOS on arm64.

Closes #19

[^1] EmmyLua/EmmyLuaDebugger#75

This patch introduces basic Tarantool debugging facilities into the
extension. Basically it is done using EmmyLuaDebugger [^1].

Set up the debugger using the following instructions.

* Insert debugger code in Tarantool application by pressing
  `Ctrl+Shift+P` (or `Cmd+Shift+P` on MacOS) and running `Tarantool:
  Insert debugger code` command.
* Start single Tarantool instance.
* Press `F5` or run `Debug: Start debugging` command by pressing
  `Ctrl+Shift+P` (or `Cmd+Shift+P` on MacOS).
* Choose `EmmyLua New Debugger` in the list. This debugging
  configuration would run automatically from now.
* Set up breakpoints & access the Tarantool instance through `Debug
  console` in the bottom panel.

These features are supported.

* Breakpoints.
* Step-by-step execution within the fiber.
* Multiple files support.
* Interacting with the local variables, console at the debug mode.

Needs EmmyLua/EmmyLuaDebugger#75 to be tested
on MacOS on arm64.

Closes #19

[^1] EmmyLua/EmmyLuaDebugger#75
@georgiy-belyanin georgiy-belyanin requested a review from Copilot June 14, 2025 15:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds basic Tarantool debugging support via EmmyLuaDebugger.

  • Introduces insertDebuggerCode in src/utils.ts to inject a Lua snippet for debugging.
  • Registers a new VS Code command tarantool.debugger-code and updates package.json.
  • Updates documentation and changelog to describe debugger usage.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils.ts Implements insertDebuggerCode and debugger snippet
src/extension.ts Registers the tarantool.debugger-code command
package.json Declares the new debugger insertion command
README.md Adds debugger usage instructions
CHANGELOG.md Logs added support for EmmyLua-based debugging
Comments suppressed due to low confidence (5)

README.md:59

  • [nitpick] Fix the grammar here. For example, replace 'It is employs' with 'It employs' to improve readability.
Tarantool VS Code extension provides debugger facility for developing Tarantool applications. It is employs EmmyLuaDebugger that is a stop-the-world Lua debugger.

README.md:34

  • This line was removed but the initialization command may still be available. If so, restore or update this step to keep the usage instructions complete.
* Run `Tarantool: Initialize VS Code extension in existing app` command from the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P` on macOS).

src/utils.ts:52

  • The new insertDebuggerCode function lacks any test coverage. Consider adding unit tests for its platform-specific path logic and snippet insertion behavior.
export async function insertDebuggerCode() {

src/utils.ts:36

  • The global function emmyHelperInit() is never defined. You should call the init method exposed by the emmy_core module (e.g., dbg.init() or assign dbg.init to _G.emmyHelperInit) so the debugger actually starts.
_G.emmyHelperInit()

src/utils.ts:33

  • [nitpick] This assignment of _G.emmyHelper is duplicated and never used elsewhere. Consider removing it or clarifying its purpose to avoid global clutter.
rawset(_G, 'emmyHelper', {})

@georgiy-belyanin georgiy-belyanin self-assigned this Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Tarantool Lua debug
1 participant