Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set unicode escape sequences to constant.character.escape scope #783

Merged
merged 2 commits into from
Oct 28, 2019
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
4 changes: 2 additions & 2 deletions TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ repository:
- include: '#binding-element-const'
- include: '#punctuation-comma'

# When doing modication to parameter name, also modify expression-inside-possibly-arrow-parens where this is inlined so as to make
# When doing modication to parameter name, also modify expression-inside-possibly-arrow-parens where this is inlined so as to make
# as optional operator only if it is not followed by assignment or type annotation
parameter-name:
patterns:
Expand Down Expand Up @@ -2545,7 +2545,7 @@ repository:

string-character-escape:
name: constant.character.escape.ts
match: \\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)
match: \\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)

template:
patterns:
Expand Down
2 changes: 1 addition & 1 deletion TypeScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -7697,7 +7697,7 @@
<key>name</key>
<string>constant.character.escape.ts</string>
<key>match</key>
<string>\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)</string>
<string>\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)</string>
</dict>
<key>template</key>
<dict>
Expand Down
2 changes: 1 addition & 1 deletion TypeScriptReact.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -7645,7 +7645,7 @@
<key>name</key>
<string>constant.character.escape.tsx</string>
<key>match</key>
<string>\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)</string>
<string>\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)</string>
</dict>
<key>template</key>
<dict>
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions tests/baselines/Issue782.baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
original file
-----------------------------------
var a = '\u1234 \u{1F600}'
-----------------------------------

Grammar: TypeScript.tmLanguage
-----------------------------------
>var a = '\u1234 \u{1F600}'
^^^
source.ts meta.var.expr.ts storage.type.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
^
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
^
source.ts meta.var.expr.ts keyword.operator.assignment.ts
^
source.ts meta.var.expr.ts
^
source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^^^^^^
source.ts meta.var.expr.ts string.quoted.single.ts constant.character.escape.ts
^
source.ts meta.var.expr.ts string.quoted.single.ts
^^^^^^^^^
source.ts meta.var.expr.ts string.quoted.single.ts constant.character.escape.ts
^
source.ts meta.var.expr.ts string.quoted.single.ts punctuation.definition.string.end.ts
6 changes: 3 additions & 3 deletions tests/baselines/TsxSamples.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@ Grammar: TypeScriptReact.tmLanguage
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx punctuation.definition.string.begin.tsx
^^^^^^
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx
^^
^^^^^^
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx constant.character.escape.tsx
^^^^^^^^^^^
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx
^^^^^^^
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx
^
source.tsx meta.var.expr.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx string.quoted.single.tsx punctuation.definition.string.end.tsx
^
Expand Down
1 change: 1 addition & 0 deletions tests/cases/Issue782.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var a = '\u1234 \u{1F600}'