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

Extend the set of tags highlighted in comments #6143

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions runtime/queries/comment/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,33 @@

":" @punctuation.delimiter

; Hint level tags
((tag (name) @hint)
(#match? @hint "^(HINT|MARK)$"))

("text" @hint
(#match? @hint "^(HINT|MARK)$"))

; Info level tags
((tag (name) @info)
(#match? @info "^(INFO|NOTE|TODO)$"))
Comment on lines +16 to +17
Copy link
Member

Choose a reason for hiding this comment

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

Changing "TODO" from @warning to @info is potentially controversial - I know that some tools or communities lint against TODOs and treat them like warnings/errors. I suppose that you can use linters for that anyway so let's give this a try and revisit it if the change is problematic 👍


("text" @info
(#match? @info "^(INFO|NOTE|TODO)$"))

; Warning level tags
((tag (name) @warning)
(#match? @warning "^(TODO|HACK|WARNING)$"))
(#match? @warning "^(HACK|WARN|WARNING)$"))

("text" @warning
(#match? @warning "^(TODO|HACK|WARNING)$"))
(#match? @warning "^(HACK|WARN|WARNING)$"))

; Error level tags
((tag (name) @error)
(match? @error "^(FIXME|XXX|BUG)$"))
(match? @error "^(BUG|FIXME|ISSUE|XXX)$"))

("text" @error
(match? @error "^(FIXME|XXX|BUG)$"))
(match? @error "^(BUG|FIXME|ISSUE|XXX)$"))

(tag
(name) @ui.text
Expand Down