Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions data/fixtures/scopes/javascriptreact/textFragment.element.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div>text</div>
---

[Content] =
[Removal] =
[Domain] = 0:5-0:9
>----<
0| <div>text</div>

[Insertion delimiter] = " "
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div>({value})</div>
---

[Content] =
[Removal] =
[Domain] = 0:5-0:14
>---------<
0| <div>({value})</div>

[Insertion delimiter] = " "
2 changes: 2 additions & 0 deletions packages/common/src/scopeSupportFacets/javascriptreact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;

export const javascriptreactScopeSupport: LanguageScopeSupportFacetMap = {
...javascriptScopeSupport,

"textFragment.element": supported,
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { goScopeSupport } from "./go";
import { htmlScopeSupport } from "./html";
import { javaScopeSupport } from "./java";
import { javascriptScopeSupport } from "./javascript";
import { javascriptreactScopeSupport } from "./javascriptreact";
import { jsonScopeSupport } from "./json";
import { jsoncScopeSupport } from "./jsonc";
import { jsonlScopeSupport } from "./jsonl";
Expand Down Expand Up @@ -41,7 +42,7 @@ export const languageScopeSupport: StringRecord<LanguageScopeSupportFacetMap> =
html: htmlScopeSupport,
java: javaScopeSupport,
javascript: javascriptScopeSupport,
javascriptreact: javascriptScopeSupport,
javascriptreact: javascriptreactScopeSupport,
json: jsonScopeSupport,
jsonc: jsoncScopeSupport,
jsonl: jsonlScopeSupport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ export const scopeSupportFacetInfos: Record<
description: "Text fragment consisting of a multi-line string",
scopeType: "textFragment",
},
"textFragment.element": {
description: "Text fragment consisting of an xml element interior",
scopeType: "textFragment",
},

disqualifyDelimiter: {
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const scopeSupportFacets = [
"textFragment.comment.block",
"textFragment.string.singleLine",
"textFragment.string.multiLine",
"textFragment.element",

"disqualifyDelimiter",
"pairDelimiter",
Expand Down
7 changes: 6 additions & 1 deletion queries/javascript.jsx.scm
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@

;;!! <div>text</div>
;;! ^^^^
(jsx_text) @textFragment
;;!! <div>({})</div>
;;! ^^^^
(
(jsx_element) @textFragment
(#child-range! @textFragment 0 -1 true true)
)
Loading