Skip to content

Request textDocument/formatting while lua_ls is loading the workspace will lose changed #2062

Closed
@leonasdev

Description

@leonasdev

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Formatting

Expected Behaviour

f you enter a buffer and do some modifications and execute vim.lsp.buf.format while lua_ls is loading the workspace, all your modifications should not be lost and the buffer should be formatted.

Actual Behaviour

If you enter a buffer and do some modifications and execute vim.lsp.buf.format while lua_ls is loading the workspace, all your modifications will be lost but the buffer is formatted correctly.

Reproduction steps

  1. Add any texts in file and save it.
  2. Add any texts again.
  3. Request textDocument/formatting while lua_ls is loading the workspace.
  4. The text in the document will be restored to its previously saved state.

Additional Notes

Related issue: neovim/neovim#22254

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions