Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions data/fixtures/scopes/rust/string.singleLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
r#"hello"#
"world"
---

[#1 Content] =
[#1 Removal] =
[#1 Domain] = 0:0-0:10
>----------<
0| r#"hello"#

[#1 Insertion delimiter] = " "


[#2 Content] =
[#2 Removal] =
[#2 Domain] = 1:0-1:7
>-------<
1| "world"

[#2 Insertion delimiter] = " "
20 changes: 20 additions & 0 deletions data/fixtures/scopes/rust/textFragment.string.singleLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
r#"hello"#
"world"
---

[#1 Content] =
[#1 Removal] =
[#1 Domain] = 0:3-0:8
>-----<
0| r#"hello"#

[#1 Insertion delimiter] = " "


[#2 Content] =
[#2 Removal] =
[#2 Domain] = 1:1-1:6
>-----<
1| "world"

[#2 Insertion delimiter] = " "
2 changes: 2 additions & 0 deletions packages/common/src/scopeSupportFacets/rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
export const rustScopeSupport: LanguageScopeSupportFacetMap = {
ifStatement: supported,
disqualifyDelimiter: supported,
"string.singleLine": supported,
"textFragment.string.singleLine": supported,
};
12 changes: 8 additions & 4 deletions queries/rust.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
(if_let_expression)
] @ifStatement

;;!! "hello"
(
[
(raw_string_literal)
(string_literal)
] @string @textFragment
(string_literal) @string @textFragment
(#child-range! @textFragment 0 -1 true true)
)

;;!! r#"foobar"#
(
(raw_string_literal) @string @textFragment
(#character-range! @textFragment 3 -2)
)

[
(line_comment)
(block_comment)
Expand Down
Loading