You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
localutf8=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.
The text was updated successfully, but these errors were encountered:
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.
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 usingrequire
.It's reasonable to have
utf8
in global namespace when user runtime is set to Lua 5.3 or later, but don't put theutf8
module in Lua 5.3 check, a.k.a. allow it to be loaded manually usingrequire
on earlier Lua version.Log File
N/A, easily reproducible.
The text was updated successfully, but these errors were encountered: