clang-tools  7.0.0
XRefs.h
Go to the documentation of this file.
1 //===--- XRefs.h ------------------------------------------------*- C++-*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===---------------------------------------------------------------------===//
9 //
10 // Features that traverse references between symbols.
11 //
12 //===---------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H
14 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H
15 
16 #include "ClangdUnit.h"
17 #include "Protocol.h"
18 #include "index/Index.h"
19 #include "llvm/ADT/Optional.h"
20 #include <vector>
21 
22 namespace clang {
23 namespace clangd {
24 
25 /// Get definition of symbol at a specified \p Pos.
26 std::vector<Location> findDefinitions(ParsedAST &AST, Position Pos,
27  const SymbolIndex *Index = nullptr);
28 
29 /// Returns highlights for all usages of a symbol at \p Pos.
30 std::vector<DocumentHighlight> findDocumentHighlights(ParsedAST &AST,
31  Position Pos);
32 
33 /// Get the hover information when hovering at \p Pos.
34 llvm::Optional<Hover> getHover(ParsedAST &AST, Position Pos);
35 
36 } // namespace clangd
37 } // namespace clang
38 #endif
Optional< Hover > getHover(ParsedAST &AST, Position Pos)
Get the hover information when hovering at Pos.
Definition: XRefs.cpp:652
std::vector< Location > findDefinitions(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Get definition of symbol at a specified Pos.
Definition: XRefs.cpp:216
std::vector< DocumentHighlight > findDocumentHighlights(ParsedAST &AST, Position Pos)
Returns highlights for all usages of a symbol at Pos.
Definition: XRefs.cpp:391
Position Pos
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//