Skip to content

Have a face for function definition #16

@KristofferC

Description

@KristofferC

Some colorschemes have a difference between a function definition and a function call:

Image

OhMyREPL also has this:

Image

But JuliaSyntaxHighlighting gives both of these a call face:

julia> using JuliaSyntaxHighlighting: highlight, highlight!

julia> str = """
       functioncall(x)

       function functiondef(x)
           return x
       end
       """;

julia> highlight(str);

julia> Base.annotations(ans)
9-element Vector{@NamedTuple{region::UnitRange{Int64}, label::Symbol, value}}:
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((1:12, :face, :julia_funcall)) <------
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((13:13, :face, :julia_rainbow_paren_1))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((15:15, :face, :julia_rainbow_paren_1))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((18:25, :face, :julia_keyword))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((27:37, :face, :julia_funcall))  <------
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((38:38, :face, :julia_rainbow_paren_1))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((40:40, :face, :julia_rainbow_paren_1))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((46:51, :face, :julia_keyword))
 @NamedTuple{region::UnitRange{Int64}, label::Symbol, value}((55:57, :face, :julia_keyword))

It would be nice if this could be detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions