[PATCH] D130041: [clangd] Add decl/def support to SymbolDetails

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 13:52:04 PDT 2022


dgoldman created this revision.
dgoldman added reviewers: kadircet, sammccall.
Herald added subscribers: usaxena95, arphaman.
Herald added a project: All.
dgoldman requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Add an optional declarationRange and definitionRange to SymbolDetails.

This will allow SourceKit-LSP to implement toggling between goto
definition/declaration based on whether the symbol at the cursor
is a definition or declaration.

In addition, make some minor fixes for ObjCMethodDecl:

- XRefs.cpp getDefinition now sees ObjC method defs but I've left a TODO to implement proper searching for impls from a decl
- nameLocation for ObjC methods should point to foo in `- (void)foo`, not the -


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130041

Files:
  clang-tools-extra/clangd/AST.cpp
  clang-tools-extra/clangd/Protocol.cpp
  clang-tools-extra/clangd/Protocol.h
  clang-tools-extra/clangd/XRefs.cpp
  clang-tools-extra/clangd/test/symbol-info.test
  clang-tools-extra/clangd/unittests/SymbolInfoTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130041.445617.patch
Type: text/x-patch
Size: 21289 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220718/ef50fc7a/attachment-0001.bin>


More information about the cfe-commits mailing list