[clangd-dev] Syntax highlighting of keywords

Ilya Biryukov via clangd-dev clangd-dev at lists.llvm.org
Tue Oct 29 07:22:35 PDT 2019


Having this in clangd and having editors ignore it complicates both clangd
and the editors.
If keyword highlightings is something that the editors are doing anyway, I
don't see how also providing them in clangd makes anything less complicated.

Also, please note clangd never provided keyword highlightings. We were
highlighting *some* keywords that referred to builtin types, e.g. int,
void, etc. And we never tried to highlight other keywords like 'final' and
'override'.

On Tue, Oct 29, 2019 at 12:54 PM Dmitri Makarov via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> Why is this a problem if clangd provides extra information, like keywords
> highlighting?  Couldn't IDEs/Editors (any LSP clients) ignore the
> information, if they have more efficient ways to highlight the keywords?
> For consistency and completeness, it seems worth providing the information.
>
> Regards,
>
> Dmitri
>
>
> On Mon, Oct 28, 2019 at 9:12 AM Ilya Biryukov via clangd-dev <
> clangd-dev at lists.llvm.org> wrote:
>
>> We're talking exclusively about semantic highlightings (e.g. the
>> highlightings that require full semantic analysis).
>> Clangd *could *potentially provide keyword highlightings as well, with
>> different latency trade-offs.
>>
>> I still feel like getting it right in the editors shouldn't be too big of
>> a problem, although some things like raw string literals obviously pose a
>> challenge.
>> Doing it in the editor provides a much more robust experience, e.g.
>> imagine losing *all *syntax highlighting because clangd crashed.
>>
>>
>> On Sat, Oct 26, 2019 at 2:39 AM Kirill Bobyrev <kbobyrev.lists at gmail.com>
>> wrote:
>>
>>> Just checking: are we talking about primitive highlighting (i.e.
>>> keywords only)? I had several problems with C++ keywords from new language
>>> standards because they are not in the default syntax files of (Neo)Vim and
>>> third-party plugins often miss some of the words. I think it makes sense to
>>> have Clangd as the “universal provider” of the updated keyword list because
>>> then I don’t have to patch Vim plugins and/or wait for the default syntax
>>> files to get updated.
>>>
>>> > On 25 Oct 2019, at 10:59, Ilya Biryukov via clangd-dev <
>>> clangd-dev at lists.llvm.org> wrote:
>>> >
>>> > Hi clangd-dev,
>>> >
>>> > I was wondering whether there's any value in the highlighting for
>>> "primitive" types being added on keywords like 'void', 'int', etc?
>>> >
>>> > - Any editor handles those with default syntax highlight.
>>> > - It's trivial and does not require actual semantic knowledge.
>>> >
>>> > With that in mind, I wonder whether we should drop this completely and
>>> just let the editors handle the keywords?
>>>
>>> > What do people think?
>>> >
>>> > --
>>> > Regards,
>>> > Ilya Biryukov
>>> > _______________________________________________
>>> > clangd-dev mailing list
>>> > clangd-dev at lists.llvm.org
>>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>>>
>>>
>>
>> --
>> Regards,
>> Ilya Biryukov
>> _______________________________________________
>> clangd-dev mailing list
>> clangd-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>>
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>


-- 
Regards,
Ilya Biryukov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20191029/5ce71692/attachment.html>


More information about the clangd-dev mailing list