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

Remove echo code action #4347

Merged
merged 6 commits into from
Mar 17, 2025
Merged

Remove echo code action #4347

merged 6 commits into from
Mar 17, 2025

Conversation

giacomocavalieri
Copy link
Member

This PR implements a code action to remove echo debug printing from the hovered expression

@inoas
Copy link
Contributor

inoas commented Mar 14, 2025

could there be a way to remove it from an entire module or whole src code? gleam fix?

@giacomocavalieri giacomocavalieri marked this pull request as draft March 15, 2025 10:07
@giacomocavalieri giacomocavalieri marked this pull request as ready for review March 15, 2025 10:20
@giacomocavalieri
Copy link
Member Author

could there be a way to remove it from an entire module or whole src code? gleam fix?

Could be a nice addition, I haven't thought of it that much, for now it just deletes the one under the cursor

@lpil
Copy link
Member

lpil commented Mar 16, 2025

This needs to remove all of them to be useful I think. It's more key presses to run the code action than to delete the echo yourself if it only works for a single one.

@giacomocavalieri
Copy link
Member Author

All echos under the selection or in the entire module?

@lpil
Copy link
Member

lpil commented Mar 16, 2025

The entire module please. Maybe the entire package?

@giacomocavalieri
Copy link
Member Author

Ok! When should the action trigger? Anywhere in the file? Sounds a bit annoying having that pop up every time if you have an echo in a module

@lpil
Copy link
Member

lpil commented Mar 16, 2025

Agreed. When on an echo sounds good?

@giacomocavalieri
Copy link
Member Author

Yeah sounds good to me, just to make sure we're on the same page: once on an echo we should offer an action "remove all echos from module" which will remove all echos, not just the hovered one?

@lpil
Copy link
Member

lpil commented Mar 16, 2025

Yes please

@giacomocavalieri
Copy link
Member Author

This should be ready now!

@inoas
Copy link
Contributor

inoas commented Mar 17, 2025

This is great <3

gleam fix echo could remove remove all echos from the project?

@lpil
Copy link
Member

lpil commented Mar 17, 2025

Something like that would be useful. We'll need to think about what would be the right API, as it'll influence future changes too.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Super nice! Couple tiny notes inline

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!!

@lpil lpil enabled auto-merge (rebase) March 17, 2025 11:12
@lpil lpil merged commit 1840b69 into gleam-lang:main Mar 17, 2025
12 checks passed
@giacomocavalieri giacomocavalieri deleted the remove-echo branch March 17, 2025 11:25
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.

3 participants