[PATCH] D95701: [clangd] Add semanticTokens modifiers for function/class/file/global scope

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 11:36:52 PST 2021


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.h:82
+  FileScope,
+  GlobalScope,
+
----------------
sammccall wrote:
> nridge wrote:
> > Would it make sense to call this `NamespaceScope` instead?
> > 
> > I understand it's "global" in the sense that it's visible to other translation units, but it's not "global" in the sense that it's not necessarily in the global namespace.
> > 
> > (On the other hand, I can see how `FileScope` symbols are also "namespace scope", so... could go either way.)
> Yeah, the file-scope thing. (Maybe it's not an important distinction, but it seems pretty interesting for functions at least)
> 
> The other consideration is that I harbor a little bit of hope we could get some convergence across implementations, so avoiding lang-specific terms is nice. In any case, client implementers are probably not C++ people!
> (of course we can use different names internally than we use in the protocol, but it seems less confusing to align them)
+1 for a distinct `FileScope` being useful


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95701



More information about the cfe-commits mailing list