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

Generic fontification v3 #410

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Aug 3, 2022

  1. 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.
    muirdm committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    269887b View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Fontify type params in type and func decls

    This involves a new anchored matcher to iterate over each
    param in the list.
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    2dddf72 View commit details
    Browse the repository at this point in the history
  2. 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.
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    9f58789 View commit details
    Browse the repository at this point in the history
  3. Fontify nest type args

    When fontifying a type list if we see another "[" we presume it is a
    nested type list and fontify it accordingly.
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    7e14db1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7068d8e View commit details
    Browse the repository at this point in the history
  5. Fontify type unions

    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    0e54930 View commit details
    Browse the repository at this point in the history
  6. 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.
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    67da7ab View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f989ce2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d02691c View commit details
    Browse the repository at this point in the history
  9. 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.
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    786b59b View commit details
    Browse the repository at this point in the history
  10. Fix fontification of composite literals w/ type params.

    Fix "foo.Bar", "int" and "string" are now fontified as types in
    "foo.Bar[int, string]{}".
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    3f6dfa5 View commit details
    Browse the repository at this point in the history
  11. Fontify type args in slice/array types

    We now fontify "foo" and "bar" as types in:
    
        []foo[bar]
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    dd43160 View commit details
    Browse the repository at this point in the history
  12. Fontify type args in RHS of type alias

    We now fontify "baz" as a type:
    
       type foo = bar[baz]
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    679945f View commit details
    Browse the repository at this point in the history
  13. Fontify type args in a couple more spots

    "bar" is now fontified as a type in:
    
        func _() foo[bar] {}
    
        var _ foo[bar]
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    d139025 View commit details
    Browse the repository at this point in the history
  14. 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]()
    muirdm committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    aa7099e View commit details
    Browse the repository at this point in the history