-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alias doesn't handle #
character in string
#3016
Comments
Root causeAfter some debugging, this is related to how a multi-line alias annotation is parsed: lua-language-server/script/parser/luadoc.lua Lines 941 to 953 in 3a39d06
---@alias DeviceSide
---| '"left"' # The left side of the device
---| '"right"' # The right side of the device
---| '"top"' # The top side of the device
---| '"bottom"' # The bottom side of the device
---| '"front"' # The front side of the device
---| '"back"' # The back side of the device
ObservationBut actually I don't quite understand the need of this logic (finding the position of ---@alias DeviceSide
---| '"left"' The left side of the device
---| '"right"' The right side of the device
---| '"top"' The top side of the device
---| '"bottom"' The bottom side of the device
---| '"front"' The front side of the device
---| '"back"' The back side of the device Possible fixI just remove the - local finishPos = nextComm.text:find('#', #resumeHead + 1) or #nextComm.text
- parseTokens(nextComm.text:sub(#resumeHead + 1, finishPos), nextComm.start + #resumeHead + 1)
+ parseTokens(nextComm.text:sub(#resumeHead + 1), nextComm.start + #resumeHead + 1)
I didn't dive deep to test it. Maybe you or others would like to finish it from there and open PR 😄 |
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
Enum members can contain
#
characterActual Behaviour
The LSP diagnostic reports an error on using it
Reproduction steps
#
Given the following alias
#
as a comment even though it's in the stringAdditional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: