[PATCH] D66990: [clangd] Add distinct highlightings for declarations of functions and methods

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 29 18:21:40 PDT 2019


nridge added a comment.
Herald added a subscriber: usaxena95.

In D66990#1656230 <https://reviews.llvm.org/D66990#1656230>, @nridge wrote:

> >> I think the way cquery does it <https://github.com/cquery-project/vscode-cquery/blob/4aac325dcf0735aa5d5f98960f28d6af6ca83d50/src/extension.ts#L84> it better in this regard: in place of a single kind enum, they essentially have a 4-tuple of `(kind, parent kind, storage class, role)`.
> > 
> > A design like this definitely makes more sense. I was thinking of a slightly simpler model: adding a set of "modifiers" to each highlighting should be enough to encode all of it, e.g. a modifier 'is class member' could be used to distinguish methods and fields from global functions and variables, a modifier 'is usage' can be used to distinguish usages from declarations, etc.
> >  But there's no combinatorial explosion in the cquery's model, which is the important bit.
>
> I will suggest this for the upstream protocol and see where that goes.


For reference, I made this suggestion here <https://github.com/Microsoft/vscode-languageserver-node/pull/367#issuecomment-536363837>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66990/new/

https://reviews.llvm.org/D66990





More information about the cfe-commits mailing list