-
-
Notifications
You must be signed in to change notification settings - Fork 363
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 our terms of service and privacy 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?
Add support for Lua 5.5 #3218
Conversation
Co-authored-by: CppCXY <[email protected]>
Lua 5.5 introduced a new Lua syntax global x for declaring global variables. Looking at the code: function f()
global y, print -- Declaring y and print as global variables
function y()
x = 123 --error
print(x)
end
end |
Co-authored-by: CppCXY <[email protected]>
I've added support for the new Lua 5.5
The parser now correctly handles the syntax from your example: function f()
global y, print -- Declaring y and print as global variables
function y()
x = 123 --error
print(x)
end
end Implemented in commit 15c897a. 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 <[email protected]>
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 commit aa06ff5. |
Co-authored-by: CppCXY <[email protected]>
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 syntax Co-authored-by: CppCXY <[email protected]>
Fixed the global parsing issues:
The parser now properly handles Implemented in commit aa69c2f. |
please add this change to changelog |
Co-authored-by: CppCXY <[email protected]>
Added Lua 5.5 features to the changelog including runtime version support, global keyword syntax, and read-only for-loop variables diagnostic. Implemented in commit 78942bc. |
|
…a 5.5 context Co-authored-by: CppCXY <[email protected]>
Fixed the global parsing to handle like |
|
Co-authored-by: CppCXY <[email protected]>
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 |
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! Click here to start the survey.