Skip to content

Multi-line alias: only lines starting with "|" should be treated as values #848

@joegnis

Description

@joegnis

In the following code, Some should not be treated as a value. Instead, Value1, Value2, and so on should.

-- Bug
---@alias Alias
--- Some comment
--- | "Value1"
--- | "Value2"

In reality, Emmy thinks Alias is

(alias) Alias = Some
comment

which is wrong. Instead, it should be

(alias) Alias = ("Value1"|"Value2")
    | "Value1"
    | "Value2"

It looks like the issue only exists if there are comments before the first value. After I remove the comments before the first value, it is fine.

-- No bug
---@alias Alias
--- | "Value1"
--- Some comment
--- | "Value2"

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