LuaLS / LuaLS/lua-language-server
Formatter deletes all code after certain syntax errors
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
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?
Formatting
Expected Behaviour
Code to be formatted without the rest of the code being deleted.
Actual Behaviour
On certain errors, the formatter seems to delete everything past the point of error (though it occasionally saves a few lines).
Reproduction steps
- Create a test lua file
- Write some lua code
- At the very top, write
anything = ....(I noticed justanything =will also cause issues) - Trigger a format run.
- Watch your code disappear.
Additional Notes
I'm not sure of all the errors that will trigger code deletion, but the ones I am aware of is:
anything = ....anything =anything = {x =}
So my initial assumption is that it just affects errors with assignments.
Log File
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the problem with the malformed assignments listed in the issue and inspect the attached log file. Trace the formatting path for syntax-error input; done means formatting preserves all code after the error while still applying formatting where possible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100