π Text formatting capabilities not reported in Neovim
Environment information
CLI:
Version: 0.0.0
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
ROME_LOG_DIR: unset
NO_COLOR: unset
TERM: "xterm-256color"
JS_RUNTIME_VERSION: unset
JS_RUNTIME_NAME: unset
NODE_PACKAGE_MANAGER: unset
Rome Configuration:
Status: unset
Workspace:
Open Documents: 0
Discovering running Rome servers...
Running Rome Server: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
i The client isn't connected to any server but rage discovered this running Rome server.
Server:
Version: 0.0.0
Name: rome_lsp
CPU Architecture: x86_64
OS: linux
Workspace:
Open Documents: 0
Other Active Server Workspaces:
Workspace:
Open Documents: 1
Client Name: Neovim
Client Version: 0.9.0
Rome Server Log:
! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
* Path names that may reveal your name, a project name, or the name of your employer.
* Source code
βββrome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("0.0.0") }}
β ββ0ms INFO rome_lsp::server Starting Rome Language Server...
βββ
βββrome_lsp::server::rome/rage{params=RageParams}
βββ
βββrome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("0.0.0") }}
β ββ0ms INFO rome_lsp::server Starting Rome Language Server...
βββ
βββrome_lsp::server::rome/rage{params=RageParams}
βββ
What happened?
- Setup the
romelanguage server withnvim-lspconfigin Neovim, with no extra config options - Open a typescript file in Neovim
- Attempt to run the command
:lua vim.lsp.buf.format() - File isn't formatted, and error message appears:
[LSP] Format request failed, no matching language servers.
Looking at the logs here: https://gist.github.com/ProspectPyxis/d3e665dedf1c0091cb27c0ec0b63ff0f, it seems like somehow, Rome just doesn't report textDocument/formatting as a capability when initializing.
Expected result
Rome should report the capability correctly and allow Neovim to format with the command.
Code of Conduct
- [X] I agree to follow Rome's Code of Conduct
you can format with rome with null-ls or just set up a format command with efm-langserver
I'm aware and have been using null-ls as a workaround, though I'd prefer to have a non-null-ls setup if possible.
I have a PR that adds support for dynamic registration to Neovim. Once it's merged, formatting will work as intended.
https://github.com/neovim/neovim/pull/23681