-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rename #127
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #127 +/- ##
==========================================
- Coverage 82.00% 80.97% -1.04%
==========================================
Files 8 8
Lines 239 247 +8
Branches 69 70 +1
==========================================
+ Hits 196 200 +4
- Misses 43 47 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Siempre un paso adelante Ivo!! 📈 🏃 💯
Faltaría algún test , no?
Y el problema de las asignaciones con +=
-=
está en
https://github.com/uqbar-project/wollok-ts/blob/master/src/parser.ts#L353
habría que marcar el send y el receiver como sintéticos.
changes: renamedNode.is(Reference) ? | ||
groupByURI(renameNode(renamedNode.target!, params.newName, environment, documents)) : | ||
groupByURI(renameNode(renamedNode, params.newName, environment, documents)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes: renamedNode.is(Reference) ? | |
groupByURI(renameNode(renamedNode.target!, params.newName, environment, documents)) : | |
groupByURI(renameNode(renamedNode, params.newName, environment, documents)), | |
changes: groupByURI(renameNode(renamedNode.is(Reference) ? renamedNode.target! : renamedNode, params.newName, environment, documents)) |
Y qué onda si no tiene target? (Una referencia rota)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saque todas las validaciones porque en requestIsRenamable
ya se valida y siempre corre antes
const renamedNode = cursorNode(environment, params.position, params.textDocument) | ||
if(!renamedNode) return null | ||
if( renamedNode.is(Reference) && renamedNode.target && isRenamable(renamedNode.target) || isRenamable(renamedNode)) { | ||
// ToDo: switch back to defaultBehavior when https://github.com/microsoft/vscode/issues/198423 is released |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vamooooooooo
const edition = new WorkspaceEdit() | ||
edition.replace(docUri, new Range(new Position(3, 15), new Position(3, 21)), 'unaComida') | ||
edition.replace(docUri, new Range(new Position(4, 24), new Position(4, 30)), 'unaComida') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chetoooooo 📈
Esto podría estar afuera y reutilizarse en el otro test
Qué groso @ivojawer ! 🎉 |
Esta seria una primer version muy limitada de renamings
Los nodos que se pueden renombrar son
Cualquier otro nodo sera rechazado
Screen.Recording.2023-12-16.at.20.52.54.mov
Hay un known issue cuando la sentencia es un assignment abreviado:
energia += comida.calorias()
Porque en esa sentencia hay dos "energia" con el mismo sourcemap, una del assignment y otra de la referencia, en mi opinion la referencia deberia ser sintetica y en ese caso se ignoraria. Que opinan?
PD: Arregle un problema con el debugger donde los archivos en subcarpetas no eran debuggeables