Skip to content
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

Improve generic pattern to support "T.*-" #3015

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

TIMONz1535
Copy link
Contributor

@TIMONz1535 TIMONz1535 commented Dec 29, 2024

#3014

Technical changes:

  • luadoc Parser now considers . and * as Symbol because I want to parse these tokens after code block, otherwise they just disappeared:
`T`.Name
code symbol name
`T`*
code symbol
  • parseCodePattern now checks these symbols .*- and integer as part of the name but only after code block.
  • Fixed crash when tokens >= 8 because it was for i = 2, 8 do and finishOffset remained nil.
  • Fixed crash with double code "`T``T`" because of content ~= nextContent when 暂时不支持多generic then we call ("%s%s"):format(val) and 2nd argument was expected.
  • Fixed wrong getStart start tokens of returned result.
  • parseCode was replaced with parseCodePattern because it didn't allow to process the cases "`T`Name" or "`T`*", now they are merged.
  • Added simple tests.

…Pattern to support "`T`.*-", prevent crash with "`T``T`" and when tokens >= 8, fix wrong getStart of result.
…-" without name token before code. Added tests.
@TIMONz1535 TIMONz1535 changed the title Improve generic pattern to support "T.*-" Improve generic pattern to support "\T\.*-" Dec 29, 2024
@TIMONz1535 TIMONz1535 changed the title Improve generic pattern to support "\T\.*-" Improve generic pattern to support "T.*-" Dec 29, 2024
@TIMONz1535
Copy link
Contributor Author

TIMONz1535 commented Dec 29, 2024

Ohh, I need to figure out how to run the tests 🫠

upd. Yeah I just copied bin from extension then launched test.lua

@sumneko
Copy link
Collaborator

sumneko commented Jan 2, 2025

nice work, thank you!

@sumneko sumneko merged commit cb964c6 into LuaLS:master Jan 2, 2025
11 checks passed
TIMONz1535 added a commit to TIMONz1535/lua-language-server that referenced this pull request Jan 6, 2025
…y and comment without a space. Fixed regression.
TIMONz1535 added a commit to TIMONz1535/lua-language-server that referenced this pull request Jan 6, 2025
…y and comment without a space. Fixed regression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants