Open
Description
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?
Diagnostics/Syntax Checking
Expected Behaviour
local a = " sss "
print('"' .. a .. '"')
local a = [[ sss ]] -- bug with a leading spaces
print('"' .. a .. '"')
local a = [[sss]]
print('"' .. a .. '"')
local a = [[
sss]]
print('"' .. a .. '"')
local a = [[
sss]] -- bug with a leading space
print('"' .. a .. '"')
local a = [[sss
]]
print('"' .. a .. '"')
local a = [[
sss
]]
print('"' .. a .. '"')
local a = [[
sss
]] -- bug with a leading space
print('"' .. a .. '"')
Parser should produce strings according to Lua rules - in a long string only the first line break is removed, but if it is the first
" sss "
" sss "
"sss"
"sss"
"
sss"
"sss
"
"sss
"
"
sss
"
Actual Behaviour
The leading spaces were skipped, presumably due to the fact that these are not tokens. Or I don't know
lua-language-server/script/parser/compile.lua
Lines 429 to 430 in cb964c6
lua-language-server/script/parser/compile.lua
Lines 381 to 394 in cb964c6
Reproduction steps
- Try to parse long string
[[ sss ]]
- Now its
[[sss ]]
Additional Notes
This also breaks the colorization in addition to #3032, most likely because it breaks the start/finish positions #3028
--[===[@param a string?ComMMul]===]
local function new(a) end
--[===[ @param a string?ComMMS1]===]
local function new(a) end
Log File
No response