Repository navigation
Description
The context of this request is a project that has:
- Many O(100k) files.
- To facilitate this, is (partially) backed by a remote filesystem.
Though the problem is also apparently for projects with O(1k) files and many references and a local fs, just less so.
There exists an LSP implementation that can deal with such large projects, it has knowledge of all the relevant files. When calling something like textDocument/references in this project (editor use: Neovim 0.5.x with builtin nvim-lsp), a list is displayed with the resulting references (called the quicklist). The format is like this:
1 caller.1.go|6 col 6| lib.CalledVeryOften()
2 caller.10.go|6 col 6| lib.CalledVeryOften()
3 caller.100.go|6 col 6| lib.CalledVeryOften()
4 caller.11.go|6 col 6| lib.CalledVeryOften()
5 caller.12.go|6 col 6| lib.CalledVeryOften()
...
The template is <filename>|<lnum> col <col>|<text>. It is user-friendly to include the text because it can already give a hint about:
- The arguments used (though in this example there are none).
- The import alias used, if any.
- Post-line comments.
Unfortunately, the textDocument/references response only contains a Location but not the line itself. So the editor has to open all files, potentially translate UTF-16 code units to whatever encoding it is using and read the line, in order to display the line.
This is quite expensive, as noted in neovim/neovim#13359.
A workaround would be to stop displaying the line snippet. That would regrettably not be as user-friendly. But I'm wondering if some thought on this had been spent on mitigating this latency/resource issue, perhaps by optionally returning the snippet in the response?
Activity
dbaeumer commentedon Dec 1, 2020
I am folding the issue with #396 with ask for similar support and we should have one solution.