dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.57k stars 1.44k forks source link

LSP relatedInformation in loclist detail #4508

Open tchamelot opened 1 year ago

tchamelot commented 1 year ago

Information

VIM version Any

Operating System: Any

What went wrong

Hello, While writing my own LSP, I identified a bug:

In the function for handling LSP diagnostic response, the diagnostic.relatedInformation is parsed into loclist_item.detail in https://github.com/dense-analysis/ale/blob/fdadaed2ba93432add241bb25f9935dc2ebb4152/autoload/ale/lsp/response.vim#L58-L68 and then the loclist_item.detail is overridden with diagnostic.message if diagnostic.source exists https://github.com/dense-analysis/ale/blob/fdadaed2ba93432add241bb25f9935dc2ebb4152/autoload/ale/lsp/response.vim#L70-L76

I suppose it would be better to reuse the previous loclist_item.detail instead of overriding it with message. So my question is: is this really a bug or a wanted feature. Depending on the answer I'll try to provide a PR with a fix.