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

Highlight error part in REPL #1957

Merged
merged 10 commits into from
Jun 19, 2024
Merged

Highlight error part in REPL #1957

merged 10 commits into from
Jun 19, 2024

Conversation

xsebek
Copy link
Member

@xsebek xsebek commented Jun 18, 2024

Closes #1956

@xsebek
Copy link
Member Author

xsebek commented Jun 18, 2024

@byorgey could you please have a look? It only works to a degree, and I suspect there are bugs:

  • This looks OK:
    Screenshot 2024-06-18 at 21 29 34
  • When no location is given it should highlight whole line:
    Screenshot 2024-06-18 at 21 30 06
  • But it seems to suspiciously extend more then it should, so likely made a mistake somewhere:
    Screenshot 2024-06-18 at 21 30 57

Feel free to push to this branch if you find anything; I am out of ideas for today. 😄

Co-authored-by: Restyled.io <commits@restyled.io>
Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

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

The part of the prompt being highlighted does not seem correct. It always seems to extend from the beginning of the error all the way to the end of the line, no matter what. For example, when I entered build {(place 2); move } everything from 2 to the closing } is red.

src/swarm-tui/Swarm/TUI/Model/Repl.hs Outdated Show resolved Hide resolved
src/swarm-tui/Swarm/TUI/Controller.hs Outdated Show resolved Hide resolved
restyled-io bot and others added 2 commits June 18, 2024 21:51
Co-authored-by: Restyled.io <commits@restyled.io>
@xsebek
Copy link
Member Author

xsebek commented Jun 18, 2024

@byorgey, after reading your comment again, I found the arithmetic bug that extended the range. 👍

Co-authored-by: Restyled.io <commits@restyled.io>
@xsebek xsebek marked this pull request as ready for review June 19, 2024 16:14
@xsebek
Copy link
Member Author

xsebek commented Jun 19, 2024

Should work well now. Please have a look.

I hit up through my history and it seemed nicely highlighted.

Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

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

Looks great! All the examples I tried seemed nicely highlighted too. Thanks for putting this together, it's a very nice feature!

@xsebek xsebek added the merge me Trigger the merge process of the Pull request. label Jun 19, 2024
Copy link
Collaborator

@nitinprakash96 nitinprakash96 left a comment

Choose a reason for hiding this comment

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

Works nicely!

@mergify mergify bot merged commit 6a4ddb3 into main Jun 19, 2024
12 checks passed
@mergify mergify bot deleted the repl-error-part branch June 19, 2024 18:07
@byorgey byorgey added the CHANGELOG Once merged, this PR should be highlighted in the changelog for the next release. label Jun 23, 2024
byorgey added a commit that referenced this pull request Jun 24, 2024
mergify bot pushed a commit that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CHANGELOG Once merged, this PR should be highlighted in the changelog for the next release. merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highlight only the problem in REPL
3 participants