dense-analysis / dense-analysis/ale
Support filename mapping for language servers
- Dominant language
- Vim Script
- Stars
- 14k
- Forks
- 1.5k
- Avg merge
- 17h 49m
- Merged PRs (30d)
- 1
Description
Hello! 👋
**The setup**: I am integrating a language server that runs remotely. Ale is able to read/write to the server over a TCP socket.
**The hiccup**: How should Ale handle different project roots for the client and server?
I have the linter defined as:
```vim
call ale#linter#Define('', {
\ 'name': '',
\ 'lsp': 'socket',
\ 'address': 'localhost:7777',
\ 'language': '',
\ 'project_root': '',
\})
```
The outgoing requests are good, but the diagnostic file paths are returned from the server's point of view, e.g.:
`"uri":"file:///"`
These file URIs obviously mean nothing to Ale.
**Guidance** How should this be handled? I'm not sure if the LS protocol provides a way for the server to know the client's project root, so I figured we could try handling it client-side. I was able to get diagnostics working by patching https://github.com/w0rp/ale/blob/fcc2c3ba71afa2a7965f3c1e9ec8c03381178180/autoload/ale/path.vim#L199-L201 to truncate everything up until ``. I was thinking that this could be done dynamically by truncating `len('file://') + len(project_root)`. Is this a reasonable approach? Are there better approaches?
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.