LuaLS / LuaLS/lua-language-server

Neovim: using the builtin formatter erases virtual lines

Open
#1,471 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feat/formatter
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?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Formatting

Expected Behaviour

Virtual lines should be preserved. Here is an example (by @whynothugo) with using StyLua as a formatter instead.

Actual Behaviour

Virtual lines get erased. The diagnostics are still there, though. Here is an example of how it looks.

Reproduction steps
  1. Setup the nvim-lspconfig and lsp_lines plugins
  2. Make sure you see the virtual lines, then format the code
  3. Are the virtual lines still there?
Additional Notes

Both examples are demonstrated by using @WhyNotHugo's lsp_lines Neovim plugin. There is a downstream issue.

Log File

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using nvim-lspconfig and the lsp_lines plugin, following the listed formatting steps and comparing virtual lines before and after formatting. Investigate the language server's formatting response and integration behavior; done means formatting preserves virtual lines while diagnostics remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.