LuaLS / LuaLS/lua-language-server

Neovim: using the builtin formatter erases virtual lines

未关闭
#1,471 11 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feat/formatter
主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 nvim-lspconfig 和 lsp_lines 插件重现该问题,按照列出的格式化步骤操作,并比较格式化前后的虚拟行。调查语言服务器的格式化响应和集成行为;当格式化能够保留虚拟行,同时诊断信息仍然可见时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。