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

Keep support for evaluating top level form in ignored forms when at top level #2655

Closed
PEZ opened this issue Oct 26, 2024 · 0 comments
Closed
Labels
evaluation structural editor Token Cursor, Lexer, et al ux User experience related

Comments

@PEZ
Copy link
Collaborator

PEZ commented Oct 26, 2024

Today I was made aware, by @rafd, that evaluate top-level form “works” when the ignored form is at the top level. This makes sense, but it would also make sense that this should include the ignore marker in the evaluation, and then nothing (or something similar to nothing) should happen. We have actually intended for the latter, but because reasons, this is quite tricky business and we have failed with the intent.

It's likely that some users has started to rely on the current behaviour (at least one has), so I think we should make the current behaviour explicit and intended in the code. It gets important when dealing with issues like these:

In rangeForDefun when we traverse the forms upwards to find the top level we check for if we are in a comment form and treat that as the top level context.

https://github.com/BetterThanTomorrow/calva/blob/published/src/cursor-doc/token-cursor.ts#L768

I think this probably is the function to deal with this, since it would allow us to figure out the general handling of ignored forms without risking that evaluating top level ignored forms stop working as intended.

@PEZ PEZ added evaluation ux User experience related structural editor Token Cursor, Lexer, et al labels Oct 26, 2024
PEZ added a commit that referenced this issue Oct 29, 2024
…of-ignores

Add test for making sure the ignore marker is not included  in top le…

* Fixes #2655
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluation structural editor Token Cursor, Lexer, et al ux User experience related
Projects
None yet
Development

No branches or pull requests

1 participant