-
Notifications
You must be signed in to change notification settings - Fork 129
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
Improve scopes of type cast declarations #798
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1375,7 +1375,7 @@ repository: | |
match: '{{startOfIdentifier}}(as)\s+(const)(?=\s*([,}]|$))' | ||
captures: | ||
'1': { name: keyword.control.as.ts } | ||
'2': { name: storage.modifier.ts } | ||
'2': { name: storage.modifier.const.type.ts } | ||
- name: meta.object.member.ts | ||
begin: '{{startOfIdentifier}}(as)\s+' | ||
beginCaptures: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add name for this as |
||
|
@@ -1561,7 +1561,7 @@ repository: | |
match: \s*(<)\s*(const)\s*(>) | ||
captures: | ||
'1': { name: meta.brace.angle.ts } | ||
'2': { name: storage.modifier.ts } | ||
'2': { name: storage.modifier.const.type.ts } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
'3': { name: meta.brace.angle.ts } | ||
- name: cast.expr.ts | ||
# We need to differentiate between the relational '<' operator and the beginning of a type assertion/cast using the surrounding context. | ||
|
@@ -1624,11 +1624,12 @@ repository: | |
- match: '{{startOfIdentifier}}(as)\s+(const)(?=\s*($|[;,:})\]]))' | ||
captures: | ||
'1': { name: keyword.control.as.ts } | ||
'2': { name: storage.modifier.ts } | ||
'2': { name: storage.modifier.const.type.ts } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
- begin: '{{startOfIdentifier}}(as)\s+' | ||
beginCaptures: | ||
'1': { name: keyword.control.as.ts } | ||
end: (?=$|^|[;,:})\]]|\|\||\&\&|({{startOfIdentifier}}(as)\s+)|(\s+\<)) | ||
contentName: meta.type.cast.ts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name this as |
||
patterns: | ||
- include: '#type' | ||
- name: keyword.operator.spread.ts | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,9 @@ Grammar: TypeScript.tmLanguage | |
^ | ||
source.ts meta.var.expr.ts | ||
^ | ||
source.ts meta.var.expr.ts entity.name.type.ts | ||
source.ts meta.var.expr.ts meta.type.cast.ts entity.name.type.ts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
^ | ||
source.ts meta.var.expr.ts | ||
source.ts meta.var.expr.ts meta.type.cast.ts | ||
^ | ||
source.ts meta.var.expr.ts keyword.operator.ternary.ts | ||
^ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not change scope for modifier
const
. Instead addname
ascast.expr.ts