diff --git a/runtime/queries/rbs/highlights.scm b/runtime/queries/rbs/highlights.scm index 9de9c427d..1c972bb9c 100644 --- a/runtime/queries/rbs/highlights.scm +++ b/runtime/queries/rbs/highlights.scm @@ -160,3 +160,6 @@ "," "." ] @punctuation.delimiter + +; RBS Inline prefix (keep comment color) +(inline_prefix) @comment diff --git a/runtime/queries/ruby/injections.scm b/runtime/queries/ruby/injections.scm index e998e2bd7..2f75c846a 100644 --- a/runtime/queries/ruby/injections.scm +++ b/runtime/queries/ruby/injections.scm @@ -1,6 +1,18 @@ ((comment) @injection.content (#set! injection.language "comment")) +((comment) @injection.content + (#lua-match? @injection.content "^#:") + (#set! injection.language "rbs")) + +((comment) @injection.content + (#lua-match? @injection.content "^#%s+@rbs") + (#set! injection.language "rbs")) + +((comment) @injection.content + (#lua-match? @injection.content "^#%s+|") + (#set! injection.language "rbs")) + (heredoc_body (heredoc_content) @injection.content (heredoc_end) @injection.language)