[PATCH] D55250: [clangd] Enhance macro hover to see full definition

Simon Marchi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 07:27:43 PST 2018


simark added inline comments.


================
Comment at: clangd/XRefs.cpp:572
+
+  // Try to get the full definition, not just the name
+  SourceLocation StartLoc = Decl.Info->getDefinitionLoc();
----------------
hokein wrote:
> if this is a complicated macro (like `AST_MATCHER`), do we still want to return all the content? they might be less useful than the simple macros.
I think it would be hard to decide here what constitutes a complicated or not-complicated macro (one for which we want to return all the content or not).  Also, I think it's fine to return the whole content, since frontends generally have good ways to present large contents in popups (hover popups that can be scrolled).

If we realize later we need to limit the size, then we can add an option where the frontend can specify a size limit.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D55250





More information about the cfe-commits mailing list