Skip to content

Display error when writing the "#" singleton type in a multi-line union annotation #1608

Description

@goldenstein64

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Annotations, Hover

Expected Behaviour

image

Actual Behaviour

image

Reproduction steps

  1. Open a new Lua file
  2. Type in this snippet:
---@alias someType
---| "#"

---@type someType
local someValue
  1. The hover type info for someType will contain miscellaneous characters -- "

image

Additional Notes

This issue goes away when omitting the last quotation mark:

---@alias someTypeHack
---| "#

---@type someTypeHack
local someValue

image

I haven't been able to reproduce this with any other special character.

This also pushes anything after the # character into a comment to the side.

---@alias someType
---| "#tag" -- comment

---@type someType
local someValue

image

Disabling all libraries did not remove the issue, and I have no plugins enabled.

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions