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

Allow a selection of text to be parsed in the playground #60

Open
NickLarsenNZ opened this issue Sep 2, 2024 · 3 comments
Open

Allow a selection of text to be parsed in the playground #60

NickLarsenNZ opened this issue Sep 2, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@NickLarsenNZ
Copy link

NickLarsenNZ commented Sep 2, 2024

Currently the whole text is parsed, which means when debugging single rules, you have to keep deleting and re-adding sections of the input text.

It would be really nice to be able to select lines to parse, so that the text input can stay relatively static while you work on the grammar rules.

image

It would be super cool if it worked the same as Github selections (where you can click a line number, hold SHIFT, then click another line number - and the URL also has a selection fragment like #L7-L15).

@tomtau tomtau added enhancement New feature or request help wanted Extra attention is needed labels Sep 2, 2024
@tomtau
Copy link
Contributor

tomtau commented Sep 2, 2024

@LeoDog896 @nathanielknight any thoughts?

@LeoDog896
Copy link
Contributor

CodeMirror doesn't have any explicit plugins for gutter-based line selection, I believe, so there would have to be a home-baked solution. Optionally, it could be based on the selected text in the editor, but that would be much more finicky. I would put the gutter selection inside the share string, though, instead of its own separate hash.

tl;dr the base feature sounds good 👍

@nathanielknight
Copy link
Contributor

I like the idea, but I agree that the implementation would be tricky. It might be easier to replace the editor with a stack of editors and let you break up your text that way instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants