-
-
Notifications
You must be signed in to change notification settings - Fork 170
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?
Conversation
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.
Makes sense to me.
Please rebase to fix merge conflicts 🙂 See PR workflow for instructions.
syntaxes/GDScript.tmLanguage.json
Outdated
@@ -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 comment
The 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 int|float|bool
?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like Godot is wrong, then.
syntaxes/GDScript.tmLanguage.json
Outdated
"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 comment
The 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.
syntaxes/GDScript.tmLanguage.json
Outdated
} | ||
} | ||
] | ||
}, | ||
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
static_unload
was just added in #738, and you're removing it here.
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.
Yes I didn't see static_unload because when i push the first changes it wasn't. You are right.
syntaxes/GDScript.tmLanguage.json
Outdated
"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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
The same of the previous comment.
syntaxes/GDScript.tmLanguage.json
Outdated
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is overwriting a change that was just made in #737.
syntaxes/GDScript.tmLanguage.json
Outdated
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
float
is a type, not a keyword, so I don't know what this rule is supposed to achieve.
This rule also does not appear to be included anywhere, so it's not even doing anything.
syntaxes/GDScript.tmLanguage.json
Outdated
"1": { "name": "keyword.language.gdscript" }, | ||
"2": { "name": "entity.other.inherited-class.gdscript" } | ||
"1": { "name": "entity.other.inherited-class.gdscript" }, | ||
"2": { "name": "keyword.language.gdscript" } |
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?
syntaxes/GDScript.tmLanguage.json
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
null
isn't a boolean
, so this is actually less accurate than it was before.
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.
Right it was for the highlighting. This should be separated.
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.
constant.language
and constant.language.boolean
appear to be highlighted the same, so I don't know what you mean here.
syntaxes/GDScript.tmLanguage.json
Outdated
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
foo as class
is already highlighted correctly as far as I can tell, so what is the purpose of this rule?
This reverts commit 0faf702.
I have reverted, I will fix properly. |
|
Added:
as
@export_category
#region
#endregion
Improved to better colors themes:
int|float|bool
Improved nodepath vars like this example:
@onready var grid_ui: CanvasLayer = $GridUI
@onready var grid_container: GridContainer = $GridUI/MarginContainer/GridContainer
Improved const color