neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
10.57k stars 2.08k forks source link

single file mode: root directory not found with Netrw "scp://" buffer #3371

Open mattthhh opened 3 days ago

mattthhh commented 3 days ago

Description

Hello, i'm using a lot scp to open and editing my files remotely. To open them, I always precise the path of the remote file in the CLI as : nvim scp://remoteserv/file.txt

But when I do this, my LSP doesn't load and I think this is because it cannot find the root directory (or getting to single file mode). That is the output of my LspInfo :

lspconfig: require("lspconfig.health").check()

LSP configs active in this session (globally)
- Configured servers: pylsp
- OK Deprecated servers: (none)

LSP configs active in this buffer (id=1)
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: python
- 0 client(s) attached to this buffer
- Other clients that match the "python" filetype:
- Config: pylsp
  filetypes:         python
  root directory:    ~/Not found.
  cmd:               ~/.local/bin/pylsp
  cmd is executable: true
  autostart:         true
  custom handlers:

Is there a way to fix that ?

justinmk commented 3 days ago

Possibly could be handled by single-file mode.

The larger topic of remote handling is tracked in https://github.com/neovim/neovim/issues/21635