[clangd-dev] Sending fixits to client with LSP diagnostics

Sam McCall via clangd-dev clangd-dev at lists.llvm.org
Fri Aug 3 22:47:30 PDT 2018


On Fri, Aug 3, 2018, 23:00 Alex L via clangd-dev <clangd-dev at lists.llvm.org>
wrote:

> Thanks for the reply! I'll work on the patch to add the support for
> fix-its.
>
> On 2 August 2018 at 03:11, Ilya Biryukov <ibiryukov at google.com> wrote:
>
>> Hi Alex,
>>
>> We discussed it internally inside our team and I think everyone agrees
>> that would be the right thing to do. We don't work on it currently, though,
>> so no overlap on our side.
>> Unfortunately, LSP does not support this, so this would be an extension.
>>
>
>> BTW, consider implementing the current scheme for fix-its that uses
>> textDocument/codeAction and matches on sent diagnostics. It's not ideal, as
>> it forces clangd to stash fix-its in memory. But it does work well in
>> practice (we've tested only in VSCode, though).
>> If you don't need to support applying diagnostics in batches, this
>> approach might work well for your use-case too.
>>
>
> Unfortunately the existing scheme doesn't really work with our system.
> We'd like to pass in all of the data we need in publishDiagnostics, and let
> the client apply the fix-its.
>
FWIW, I think our internal pseudo-LSP-over-protobuf client does the same
thing.
So the C++ API in ClangdServer *should* all be there, making this extension
straightforward. And if you lean towards making the XPC service a different
protocol, this is certainly a sensible place to diverge.
IMO this is a place where LSP is a bit hamstrung by VSCode's UI
idiosyncrasies...

(Still out on parental leave for a couple of weeks, so I might be missing
some relevant discussions)


> Cheers,
> Alex
>
>
>>
>>
>> On Wed, Aug 1, 2018 at 10:19 PM Alex L via clangd-dev <
>> clangd-dev at lists.llvm.org> wrote:
>>
>>> Hi,
>>>
>>> Has there been any discussion on sending fixits from the server to
>>> client as part of the 'publishDiagnostics' LSP response?
>>> I would like to start working on an extension for this (disabled by
>>> default), and would like to avoid duplicate work if there are already
>>> people working on it :)
>>>
>>> Thanks,
>>> Alex
>>> _______________________________________________
>>> clangd-dev mailing list
>>> clangd-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>>>
>>
>>
>> --
>> Regards,
>> Ilya Biryukov
>>
>
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20180804/b0f0f0be/attachment.html>


More information about the clangd-dev mailing list