# HG changeset patch # User Michael Davis # Date 1746193521 14400 # Node ID 9766d2a1e3adf0dfaa762dc2d05c2482f00ad441 # Parent b14edc3dcf07859b6901dfa36b81fb06e1f3249e queries: Fix `comment.unused` highlights in Erlang * Other languages use `comment.unused` instead of `comment.discard`. * Fix the precedence of discarded variables - previously the parameter highlight was higher precedence so discarded variables in the parameter list were highlighted as parameters instead of `comment.unused`. diff -r b14edc3dcf07 -r 9766d2a1e3ad runtime/queries/erlang/highlights.scm --- a/runtime/queries/erlang/highlights.scm Thu May 01 13:54:45 2025 -0700 +++ b/runtime/queries/erlang/highlights.scm Fri May 02 09:45:21 2025 -0400 @@ -1,5 +1,5 @@ ; Comments -(tripledot) @comment.discard +(tripledot) @comment.unused [(comment) (line_comment) (shebang)] @comment @@ -114,10 +114,6 @@ ] @comment.block.documentation) (#any-of? @keyword "doc" "moduledoc")) -; Ignored variables -((variable) @comment.discard - (#match? @comment.discard "^_")) - ; Macros (macro "?"+ @keyword.directive @@ -163,3 +159,7 @@ (record field: (atom) @variable.other.member) (record name: (atom) @type) + +; Ignored variables +((variable) @comment.unused + (#match? @comment.unused "^_"))