Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork366
Add support for Lua 5.5#3218
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
Lua 5.5 introduced a new Lua syntax global x for declaring global variables. Looking at the code: functionf()globaly,print-- Declaring y and print as global variablesfunctiony()x=123--errorprint(x)endend |
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
CopilotAI commentedJul 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've added support for the new Lua 5.5
The parser now correctly handles the syntax from your example: functionf()globaly,print-- Declaring y and print as global variablesfunctiony()x=123--errorprint(x)endend Implemented in commit15c897a. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Lua 5.5 introduce feature: |
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
I've implemented the read-only for-loop variables check for Lua 5.5. The diagnostic now detects when you try to assign to for-loop variables and reports an error with the message "Cannot assign to for-loop variable The implementation:
Implemented in commitaa06ff5. |
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
There are some issues with global parsing: if it's not version 5.5, it shouldn't generate errors and should fall back to other branches directly. Users might write |
…nt global function syntaxCo-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
Fixed the global parsing issues:
The parser now properly handles Implemented in commitaa69c2f. |
please add this change to changelog |
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
Added Lua 5.5 features to the changelog including runtime version support, global keyword syntax, and read-only for-loop variables diagnostic. Implemented in commit78942bc. |
|
…a 5.5 contextCo-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
Fixed the global parsing to handle like |
|
Co-authored-by: CppCXY <40318218+CppCXY@users.noreply.github.com>
I've reimplemented readonly-for-loop-vars as a parser-stage error. The implementation now detects assignments to for-loop variables during parsing and reports a |
提交太大了。希望每个功能点是一个单独的PR。 |
Issues-translate-bot commentedJul 15, 2025
The submission is too big. Hopefully each feature point is a separate PR. |
许愿未来把Lua新版本手册发给AI看,就能自动帮我实现所有功能 |
Issues-translate-bot commentedJul 15, 2025
Make a wish to send the new version of Lua to AI in the future, and it will automatically help me realize all functions |
Maybe we should wait until 5.5 is fully released? PUC-Rio is considering some changes to the syntax |
Uh oh!
There was an error while loading.Please reload this page.
This PR adds comprehensive support for Lua 5.5 to the lua-language-server, allowing users to configure their runtime version to "Lua 5.5" and receive appropriate language support.
Changes Made
Configuration Support
"Lua.runtime.version": "Lua 5.5"
in their configurationLanguage Features
_VERSION
string definition in meta templateswarn()
function support (available in >5.4)Runtime Behavior
require()
function returnsunknown
type for second return valueDocumentation
Testing
All existing tests continue to pass, ensuring backward compatibility and that the new Lua 5.5 support doesn't break existing functionality for other Lua versions.
Example Usage
Fixes#3217.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.