Skip to content

format with rnix-lsp leaves selection #2655

@farwyler

Description

@farwyler

Summary

when using format with rnix-lsp the whole buffer remains selected after formatting. this does not happen with other lsps (tested with rust-analyzer and typescript ls)

Reproduction Steps

  1. setup rnix-lsp
  2. open .nix file
{
  description = "bug";
}
  1. use format command or write with auto-format
  2. the text is formated correctly
  3. whole buffer remains in selection

Helix log

2022-06-03T08:39:34.329 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///Users/xxx/projects/helix/test.nix"}}
2022-06-03T08:39:39.975 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/formatting","params":{"options":{"insertSpaces":true,"tabSize":2},"textDocument":{"uri":"file:///Users/xxx/projects/helix/test.nix"}},"id":1}
2022-06-03T08:39:39.976 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":[{"newText":"{\n  description = \"bug\";\n}\n","range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}}}]}
2022-06-03T08:39:39.976 helix_lsp::transport [INFO] <- [{"newText":"{\n  description = \"bug\";\n}\n","range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}}}]
2022-06-03T08:39:39.978 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}},"text":"{\n  description = \"bug\";\n}\n"}],"textDocument":{"uri":"file:///Users/xxx/projects/helix/test.nix","version":3}}}
2022-06-03T08:39:39.978 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///Users/xxx/projects/helix/test.nix"}}
2022-06-03T08:39:41.569 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","params":null,"id":2}
2022-06-03T08:39:41.569 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"result":null}
2022-06-03T08:39:41.570 helix_lsp::transport [INFO] <- null
2022-06-03T08:39:41.570 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit","params":null}
2022-06-03T08:39:41.571 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-06-03T08:39:41.571 helix_lsp::transport [ERROR] err: <- StreamClosed

Platform

macOS

Terminal Emulator

kitty

Helix Version

22.05-24-gfd4858c0

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