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

Don't Disable UTF-8 Module on Lua < 5.3 #1796

Closed
MikuAuahDark opened this issue Dec 29, 2022 · 1 comment
Closed

Don't Disable UTF-8 Module on Lua < 5.3 #1796

MikuAuahDark opened this issue Dec 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@MikuAuahDark
Copy link

MikuAuahDark commented Dec 29, 2022

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, Libraries

Expected Behaviour

local utf8 = require("utf8") gives UTF-8 function definitions regardless of Lua version.

Actual Behaviour

local utf8 = require("utf8") only gives UTF-8 function definitions if Lua runtime version is 5.3 or later.

Reproduction steps

Reproducible with one line of code.

local utf8 = require("utf8")

On Lua runtime < 5.3, utf8 is unknown.

Additional Notes

Some Lua < 5.3 environments (e.g. love) provides Lua 5.3 utf8 module but this must be loaded separately using require.

It's reasonable to have utf8 in global namespace when user runtime is set to Lua 5.3 or later, but don't put the utf8 module in Lua 5.3 check, a.k.a. allow it to be loaded manually using require on earlier Lua version.

Log File

N/A, easily reproducible.

@sumneko sumneko added the bug Something isn't working label Jan 3, 2023
@sumneko
Copy link
Collaborator

sumneko commented Jan 3, 2023

Should be resolved by setting runtime.builtin, but it dose not work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants