-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Improved GDScript.tmLanguage.json #740
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -27,10 +27,11 @@ | |
] | ||
}, | ||
"extends_statement": { | ||
"name": "entity.other.inherited-class.gdscript", | ||
"match": "(extends)\\s+([a-zA-Z_]\\w*\\.[a-zA-Z_]\\w*)?", | ||
"captures": { | ||
"1": { "name": "keyword.language.gdscript" }, | ||
"2": { "name": "entity.other.inherited-class.gdscript" } | ||
"1": { "name": "entity.other.inherited-class.gdscript" }, | ||
"2": { "name": "keyword.language.gdscript" } | ||
} | ||
}, | ||
"expression": { | ||
|
@@ -43,6 +44,7 @@ | |
{ "include": "#builtin_classes" }, | ||
{ "include": "#class_new" }, | ||
{ "include": "#class_is" }, | ||
{ "include": "#class_as" }, | ||
{ "include": "#class_enum" }, | ||
{ "include": "#any_method" }, | ||
{ "include": "#any_variable" }, | ||
|
@@ -74,10 +76,12 @@ | |
{ "include": "#square_braces" }, | ||
{ "include": "#round_braces" }, | ||
{ "include": "#function_call" }, | ||
{ "include": "#comment" }, | ||
{ "include": "#self" }, | ||
{ "include": "#func" }, | ||
{ "include": "#letter" }, | ||
{ "include": "#region" }, | ||
{ "include": "#endregion" }, | ||
{ "include": "#comment" }, | ||
{ "include": "#numbers" }, | ||
{ "include": "#pascal_case_class" }, | ||
{ "include": "#line_continuation" } | ||
|
@@ -190,7 +194,7 @@ | |
"patterns": [ | ||
{ | ||
"match": "\\bin\\b", | ||
"name": "keyword.control.gdscript" | ||
"name": "keyword.control.in.gdscript" | ||
}, | ||
{ "include": "#base_expression" }, | ||
{ "include": "#any_variable" }, | ||
|
@@ -250,7 +254,15 @@ | |
}, | ||
"letter": { | ||
"match": "\\b(?:true|false|null)\\b", | ||
"name": "constant.language.gdscript" | ||
"name": "constant.language.boolean.gdscript" | ||
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.
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. Right it was for the highlighting. This should be separated. 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.
|
||
}, | ||
"region": { | ||
"match": "#region\\s+([a-zA-Z_]\\w*)", | ||
"name": "keyword.preprocessor.region.gdscript" | ||
}, | ||
"endregion": { | ||
"match": "#endregion", | ||
"name": "keyword.preprocessor.endregion.gdscript" | ||
}, | ||
"numbers": { | ||
"patterns": [ | ||
|
@@ -302,10 +314,10 @@ | |
"name": "keyword.operator.assignment.gdscript" | ||
}, | ||
{ | ||
"match": "(:)\\s*([a-zA-Z_]\\w*)?", | ||
"match": "(:)\\s*\\b(int|float|bool)\\b", | ||
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. This rule needs to match any valid type, why did you change it to 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. Because in Godot the 3 vars are highlighted separated than others. I not sure if more vars types are like this 3. 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. Sounds like Godot is wrong, then. |
||
"captures": { | ||
"1": { "name": "punctuation.separator.annotation.gdscript" }, | ||
"2": { "name": "entity.name.type.class.gdscript" } | ||
"2": { "name": "entity.name.type.variable.gdscript" } | ||
} | ||
}, | ||
{ | ||
|
@@ -363,11 +375,18 @@ | |
"2": { "name": "entity.name.type.class.gdscript" } | ||
} | ||
}, | ||
"class_as": { | ||
"match": "\\s+(as)\\s+([a-zA-Z_]\\w*)", | ||
"captures": { | ||
"1": { "name": "storage.type.as.gdscript" }, | ||
"2": { "name": "entity.name.type.class.gdscript" } | ||
} | ||
}, | ||
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.
|
||
"class_enum": { | ||
"match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)", | ||
"captures": { | ||
"1": { "name": "entity.name.type.class.gdscript" }, | ||
"2": { "name": "variable.other.enummember.gdscript" } | ||
"2": { "name": "constant.language.gdscript" } | ||
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. This is overwriting a change that was just merged in #737, please revert this. |
||
} | ||
}, | ||
"class_name": { | ||
|
@@ -403,46 +422,50 @@ | |
"name": "meta.literal.nodepath.bare.gdscript", | ||
"match": "(?<!/\\s*)(\\$\\s*|%|\\$%\\s*)(/\\s*)?([a-zA-Z_]\\w*)\\b(?!\\s*/)", | ||
"captures": { | ||
"1": { "name": "keyword.control.flow.gdscript" }, | ||
"2": { "name": "constant.character.escape.gdscript" }, | ||
"3": { "name": "constant.character.escape.gdscript" }, | ||
"4": { "name": "constant.character.escape.gdscript" } | ||
"1": { "name": "keyword.control.flow.nodepath.gdscript" }, | ||
"2": { "name": "constant.character.escape.nodepath.gdscript" }, | ||
"3": { "name": "constant.character.escape.nodepath.gdscript" }, | ||
"4": { "name": "constant.character.escape.nodepath.gdscript" } | ||
} | ||
}, | ||
"builtin_get_node_shorthand_bare_multi": { | ||
"name": "meta.literal.nodepath.bare.gdscript", | ||
"begin": "(\\$\\s*|%|\\$%\\s*)(/\\s*)?([a-zA-Z_]\\w*)", | ||
"beginCaptures": { | ||
"1": { "name": "keyword.control.flow.gdscript" }, | ||
"2": { "name": "constant.character.escape.gdscript" }, | ||
"3": { "name": "constant.character.escape.gdscript" } | ||
"1": { "name": "keyword.control.flow.nodepath.gdscript" }, | ||
"2": { "name": "constant.character.escape.nodepath.gdscript" }, | ||
"3": { "name": "constant.character.escape.nodepath.gdscript" } | ||
}, | ||
"end": "(?!\\s*/\\s*%?\\s*[a-zA-Z_]\\w*)", | ||
"patterns": [ | ||
{ | ||
"match": "(/)\\s*(%)?\\s*([a-zA-Z_]\\w*)\\s*", | ||
"captures": { | ||
"1": { "name": "constant.character.escape.gdscript" }, | ||
"2": { "name": "keyword.control.flow.gdscript" }, | ||
"3": { "name": "constant.character.escape.gdscript" } | ||
"1": { "name": "constant.character.escape.nodepath.gdscript" }, | ||
"2": { "name": "keyword.control.flow.nodepath.gdscript" }, | ||
"3": { "name": "constant.character.escape.nodepath.gdscript" } | ||
} | ||
} | ||
] | ||
}, | ||
"annotations": { | ||
"match": "(@)(export|export_color_no_alpha|export_custom|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_global_dir|export_global_file|export_multiline|export_node_path|export_placeholder|export_range|export_storage|icon|onready|rpc|tool|warning_ignore|abstract|static_unload)\\b", | ||
"match": "(@)(export|export_color_no_alpha|export_custom|export_category|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_global_dir|export_global_file|export_multiline|export_node_path|export_placeholder|export_range|export_storage|icon|onready|rpc|tool|warning_ignore|abstract)\\b", | ||
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.
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. Yes I didn't see static_unload because when i push the first changes it wasn't. You are right. |
||
"captures": { | ||
"1": { "name": "entity.name.function.decorator.gdscript" }, | ||
"2": { "name": "entity.name.function.decorator.gdscript" } | ||
} | ||
}, | ||
"builtin_classes": { | ||
"match": "(?<![^.]\\.|:)\\b(Vector2|Vector2i|Vector3|Vector3i|Vector4|Vector4i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|Signal|Callable|StringName|Quaternion|Projection|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedVector4Array|PackedColorArray|super)\\b", | ||
"match": "(?<![^.]\\.|:)\\b(Vector2|Vector2i|Vector3|Vector3i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|StringName|Quaternion|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedColorArray|super)\\b", | ||
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. This line is removing several types that were added in #738. 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. The same of the previous comment. |
||
"name": "entity.name.type.class.builtin.gdscript" | ||
}, | ||
"keyword_type_float": { | ||
"match": "(?<![^.]\\.|:)\\b(float)\\b", | ||
"name": "keyword.type.float.gdscript" | ||
}, | ||
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.
This rule also does not appear to be included anywhere, so it's not even doing anything. |
||
"const_vars": { | ||
"match": "\\b([A-Z_][A-Z_0-9]*)\\b", | ||
"name": "variable.other.constant.gdscript" | ||
"name": "constant.language.gdscript" | ||
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. This is overwriting a change that was just made in #737. |
||
}, | ||
"pascal_case_class": { | ||
"match": "\\b([A-Z]+[a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b", | ||
|
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.
What exactly is the intention here?