Skip to content

Syntax highlight Int[] etc. #198

Description

@karajan9

It would be nice to highlight the types in array creation statements like Int[] the same way they are highlighted with Vector{Int}().
As @pfitzseb mentioned on Slack, simply highlighting everything before [] runs into problems with a[] after a = Ref{Int}(), to which he suggested to highlight only TitleCase.

Pros:

  • extra highlighting makes the code easier to read
  • consistency with highlighting types elsewhere

Cons:

  • it will give a false negative for people who don't use TitleCase for their own types
  • it will give a false positive for people who use TitleCase for their variables and use Ref

Since the Julia manual suggests "modules and type names use capitalization and camel case: module SparseArrays, struct UnitRange." and the next logical step would to use everything but this for variables, one could argue that the cons shouldn't affect too many people.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions