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

Highlighted the UNREACHABLE element in cram .t file #754

Merged
merged 5 commits into from
Oct 26, 2021

Conversation

SaySayo
Copy link
Contributor

@SaySayo SaySayo commented Oct 25, 2021

Fixes #748. @mnxn please review

Highlighted the ***** UNREACHABLE ***** element in cram `.t` files
syntaxes/cram.json Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@mnxn
Copy link
Collaborator

mnxn commented Oct 25, 2021

Unfortunately after testing this, it seems that ***** UNREACHABLE ***** is currently highlighted as comment.
It has to be moved up in the "patterns" list to not be a comment. Try to move right after the "command" rule.

Additionally, it appears that the rule has to match the newline/endline to work correctly:

{
  "comment": "***** UNREACHABLE *****",
  "match": "^  (\\*\\*\\*\\*\\*[[:space:]]UNREACHABLE[[:space:]]\\*\\*\\*\\*\\*)$",
  "captures": {
    "1": { "name": "invalid.unreachable.cram" }
  }
}

@SaySayo
Copy link
Contributor Author

SaySayo commented Oct 26, 2021

Screenshot 2021-10-26 at 10 06 18

@mnxn it now highlights as an error

Copy link
Collaborator

@mnxn mnxn left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for your contribution!

@mnxn mnxn merged commit e62b5b2 into ocamllabs:master Oct 26, 2021
@SaySayo SaySayo deleted the Improve-cram-files-syntax-highlighting branch October 26, 2021 14:59
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.

Highlight unreachable element in Cram files
2 participants