Skip to content
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

Debugger improvements #195

Merged
merged 15 commits into from
Jan 16, 2025
Merged

Debugger improvements #195

merged 15 commits into from
Jan 16, 2025

Conversation

ivojawer
Copy link
Contributor

@ivojawer ivojawer commented Nov 20, 2024

  • imprimir resultado ejecucion (exception/termino todo bien)
  • Saltear nodos sinteticos (soluciona x += 4)
  • Poner breakpoints en medio de una sentencia (breakpoint locations)
  • Evaluar expresiones mientras debuggeo (watch/debug console)
  • Iniciar debugger desde un code lens (programs/tests)
  • [Abandonado, Debuggear un describe #201] Iniciar debugger desde un conde lens (describe)

Depende de uqbar-project/wollok-ts#325

@ivojawer ivojawer marked this pull request as ready for review January 15, 2025 06:21
@ivojawer ivojawer requested a review from PalumboN January 15, 2025 06:21
Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

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

Buenisimoooo!! 💯 🚀 👍 🐞

Dejé un par de comments para charlar

@@ -28,6 +30,7 @@ const lspMessagesEs = {
[COMMAND_RUN_ALL_TESTS]: 'Ejecutar todos los tests',
[COMMAND_RUN_TEST]: 'Ejecutar test',
[COMMAND_EXECUTE]: 'Ejecutar {0}',
[COMMAND_EXECUTE_DEBUG]: 'Depurar {0}',
Copy link
Contributor

Choose a reason for hiding this comment

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

🫤

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Creo que esto ya lo habiamos hablado entre los tres! Para mi da medio lo mismo depurar/debug

packages/debug-adapter/src/test/debug-adapter.test.ts Outdated Show resolved Hide resolved
supportsDelayedStackTraceLoading: true,
supportsConfigurationDoneRequest: true,
supportsSingleThreadExecutionRequests: false,
}

this.positionConverter = new WollokPositionConverter(args.linesStartAt1, args.columnsStartAt1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Esto viene por args? Por qué?

Copy link
Contributor Author

@ivojawer ivojawer Jan 15, 2025

Choose a reason for hiding this comment

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

Porque depende de cliente, este debugger esta medio acoplado a vscode/node pero en realidad deberia poder comunicarse con cualquier IDE entonces te llega esto por args cuando inicia la sesion de debugging.

Me la juego a que en el server tambien habria que hacer algo parecido

packages/debug-adapter/src/debug-session.ts Outdated Show resolved Hide resolved
packages/debug-adapter/src/debug-session.ts Outdated Show resolved Hide resolved
packages/debug-adapter/src/debug-session.ts Outdated Show resolved Hide resolved
Comment on lines 113 to 118
const nodesToBreakAt = breakpointsPackage.descendants.filter((node: Node) => {
return args.breakpoints.some(breakpoint =>
breakpoint.column ?
this.positionConverter.convertDebuggerLineToClient(node.sourceMap?.start.line) === breakpoint.line && this.positionConverter.convertDebuggerColumnToClient(node.sourceMap?.start.column) === breakpoint.column :
node.is(Sentence) && node.parent.is(Body) && this.positionConverter.convertDebuggerLineToClient(node.sourceMap?.start.line) === breakpoint.line
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Acá no se debería reutilizar una lógica como la de cursorNode? Que vaya de Location a Node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Si, el tema es que esa logica esta en otro package (server), en su momento queria tener un package aparte que sea de logica compartida entre server, client y debugger. PERO el tema es que entre ellos conflictuan los tipados para las mismas entidades. Una position en el server no es lo mismo que una en el debugger.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sí, habría que pensar una API más piola que se pueda reutilizar en to'lado

packages/debug-adapter/src/debug-session.ts Show resolved Hide resolved
Comment on lines +240 to +246
const currentEvaluation = args.context === 'repl' ? this.interpreter.evaluation : this.interpreter.evaluation.copy()
const frame = args.frameId ? this.frames.get(args.frameId) : currentEvaluation.currentFrame
const execution = interprete(
new Interpreter(currentEvaluation),
args.expression,
frame
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Chetooooo 😎

@PalumboN PalumboN merged commit 1d19045 into master Jan 16, 2025
5 of 6 checks passed
@PalumboN PalumboN deleted the debugger-improvements branch January 16, 2025 19:58
@ivojawer ivojawer linked an issue Jan 29, 2025 that may be closed by this pull request
12 tasks
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.

[EPIC] Debugger
3 participants