Skip to content

Formatter deletes all code after certain syntax errors #1907

Open
@fatboychummy

Description

@fatboychummy

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).

ding196.mp4

Reproduction steps

  1. Create a test lua file
  2. Write some lua code
  3. At the very top, write anything = .... (I noticed just anything = will also cause issues)
  4. Trigger a format run.
  5. 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

file_d%3A_test%20directory.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions