-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
joker1007/tree-sitter-rbs
#17Description
I've been trying to bring this feature over to Zed: Shopify/ruby-lsp#3215
Here are some Tree Sitter Queries to match the comments:
; RBS Inline: #: syntax
((comment) @content
(#match? @content "^#:")
(#set! "language" "rbs"))
; RBS Inline: #| continuation syntax
((comment) @content
(#match? @content "^#\\|")
(#set! "language" "rbs"))
; RBS Inline: # @rbs syntax
((comment) @content
(#match? @content "^#\\s*@rbs")
(#set! "language" "rbs"))I tried adding them to languages/ruby/injections.scm, tried to unmatch the RBS Inline comments languages/ruby/overrides.scm and languages/ruby/highlights.scm but I couldn't get it to work.
Also using (#set! injection.language "rbs")) and uppercase "RBS" doesn't work either. Initially I thought we might have to use #offset to make sure are strip out the #:, #|, or # @rbs but it doesn't seem to make a difference.
But maybe I'm missing something to make it work, which is why I'm opening this issue.
Metadata
Metadata
Assignees
Labels
No labels