LuaLS / LuaLS/lua-language-server
Parser. Long string doesn't contain leading spaces
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Lua
- Sterne
- 4.4k
- Forks
- 442
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit script/parser/compile.lua an den referenzierten Zeilen 381-394 und 429-430 und reproduziere dann die aufgeführten long-string-Fälle. Vergleiche die geparsten Werte und Quellbereiche mit den erwarteten Lua-Ausgaben, einschließlich führender Leerzeichen und Zeilenumbrüche. Erledigt ist es, wenn führende Leerzeichen erhalten bleiben und die betroffene Einfärbung sowie die Start-/Endpositionen nicht mehr regressieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- lua
- Bereich
- compilers, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100