-
Notifications
You must be signed in to change notification settings - Fork 211
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
Generic fontification v3 #410
base: master
Are you sure you want to change the base?
Commits on Aug 3, 2022
-
Fix normal param font locking in sigs with type params.
Now at least type param lists don't break the font locking of later param lists in the signature.
Configuration menu - View commit details
-
Copy full SHA for 269887b - Browse repository at this point
Copy the full SHA 269887bView commit details
Commits on Oct 6, 2022
-
Fontify type params in type and func decls
This involves a new anchored matcher to iterate over each param in the list.
Configuration menu - View commit details
-
Copy full SHA for 2dddf72 - Browse repository at this point
Copy the full SHA 2dddf72View commit details -
Fontify type args in new()/make()
This uses a cheeky approach where we piggyback off existing type matching. After using the existing matcher to fontify "foo" in make(foo[bar]), we then check if the next char is "[", and if so we know it is a type list, so we fontify it as such. This approach will be used in later commits for all the other simple type matchers.
Configuration menu - View commit details
-
Copy full SHA for 9f58789 - Browse repository at this point
Copy the full SHA 9f58789View commit details -
When fontifying a type list if we see another "[" we presume it is a nested type list and fontify it accordingly.
Configuration menu - View commit details
-
Copy full SHA for 7e14db1 - Browse repository at this point
Copy the full SHA 7e14db1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7068d8e - Browse repository at this point
Copy the full SHA 7068d8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e54930 - Browse repository at this point
Copy the full SHA 0e54930View commit details -
Fix fontification of generic func names.
Now we fontify func names in generic invocations when there are more than one type params (so we can be sure it is a func instantiation). I also tweaked things to avoid fontifying "bar" in (foo)(bar)(baz) (fixes dominikh#385). We also support fontifying method names with type params even though that isn't allowed yet.
Configuration menu - View commit details
-
Copy full SHA for 67da7ab - Browse repository at this point
Copy the full SHA 67da7abView commit details -
Configuration menu - View commit details
-
Copy full SHA for f989ce2 - Browse repository at this point
Copy the full SHA f989ce2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d02691c - Browse repository at this point
Copy the full SHA d02691cView commit details -
Fontify type params in "map" types
For example, we now fontify a, b, c and d as types: map[a[b]]c[d] This required tweaking the map value matcher to allow square brackets to appear in the map key type.
Configuration menu - View commit details
-
Copy full SHA for 786b59b - Browse repository at this point
Copy the full SHA 786b59bView commit details -
Fix fontification of composite literals w/ type params.
Fix "foo.Bar", "int" and "string" are now fontified as types in "foo.Bar[int, string]{}".
Configuration menu - View commit details
-
Copy full SHA for 3f6dfa5 - Browse repository at this point
Copy the full SHA 3f6dfa5View commit details -
Fontify type args in slice/array types
We now fontify "foo" and "bar" as types in: []foo[bar]
Configuration menu - View commit details
-
Copy full SHA for dd43160 - Browse repository at this point
Copy the full SHA dd43160View commit details -
Fontify type args in RHS of type alias
We now fontify "baz" as a type: type foo = bar[baz]
Configuration menu - View commit details
-
Copy full SHA for 679945f - Browse repository at this point
Copy the full SHA 679945fView commit details -
Fontify type args in a couple more spots
"bar" is now fontified as a type in: func _() foo[bar] {} var _ foo[bar]
Configuration menu - View commit details
-
Copy full SHA for d139025 - Browse repository at this point
Copy the full SHA d139025View commit details -
Fontify any index list as a type list
If there is more than one thing in between "[]", we know it is a type list. Now we fontify "int" and "string" as types in: foo[int, string]()
Configuration menu - View commit details
-
Copy full SHA for aa7099e - Browse repository at this point
Copy the full SHA aa7099eView commit details