clang-tools 8.0.0

FindSymbols.h
Go to the documentation of this file.
1 //===--- FindSymbols.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 // Queries that provide a list of symbols matching a string.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FINDSYMBOLS_H
14 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FINDSYMBOLS_H
15
16 #include "Protocol.h"
17 #include "llvm/ADT/StringRef.h"
18
19 namespace clang {
20 namespace clangd {
21 class ParsedAST;
22 class SymbolIndex;
23
24 /// Searches for the symbols matching \p Query. The syntax of \p Query can be
25 /// the non-qualified name or fully qualified of a symbol. For example, "vector"
26 /// will match the symbol std::vector and "std::vector" would also match it.
27 /// Direct children of scopes (namepaces, etc) can be listed with a trailing
28 /// "::". For example, "std::" will list all children of the std namespace and
29 /// "::" alone will list all children of the global namespace.
30 /// \p Limit limits the number of results returned (0 means no limit).
31 /// \p HintPath This is used when resolving URIs. If empty, URI resolution can
32 /// fail if a hint path is required for the scheme of a specific URI.
33 llvm::Expected<std::vector<SymbolInformation>>
34 getWorkspaceSymbols(llvm::StringRef Query, int Limit,
35 const SymbolIndex *const Index, llvm::StringRef HintPath);
36
37 /// Retrieves the symbols contained in the "main file" section of an AST in the
38 /// same order that they appear.
39 llvm::Expected<std::vector<DocumentSymbol>> getDocumentSymbols(ParsedAST &AST);
40
41 } // namespace clangd
42 } // namespace clang
43
44 #endif
clang::clangd::getWorkspaceSymbols
llvm::Expected< std::vector< SymbolInformation > > getWorkspaceSymbols(llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath)
Searches for the symbols matching Query.
Definition: FindSymbols.cpp:103
Protocol.h
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::clangd::getDocumentSymbols
llvm::Expected< std::vector< DocumentSymbol > > getDocumentSymbols(ParsedAST &AST)
Retrieves the symbols contained in the "main file" section of an AST in the same order that they appe...
Definition: FindSymbols.cpp:322
Index
const SymbolIndex * Index
Definition: Dexp.cpp:85