Skip to content

Extra whitespace after fun keyword breaks syntax highlighting #169

@freahs

Description

@freahs

When defining an anonymous function only a single whitespace seems to be accepted between the fun keyword and the (paranthesized) parameters. When adding another space or a newline directly after the fun keyword, remaining function definitions in the document will be misidentified as function calls. Beside breaking syntax highlighting this seems to have the effect that when writing a new function definition they are automatically indented.

-module(m).

f1() ->
    fun () -> ok end.
f2() ->
    fun 
        () -> ok
    end.
f3() -> 
    ok.

When activating "Developer: Inspect Editor Tokens and Scopes" in command palette and moving cursor to f3 in the above example, textmate scopes include meta.function-call.erlang and meta.expression.fun.implicit.erlang instead of entity.name.function.definition.erlang.

Extension version is v0.0.46

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