LCOV - code coverage report
Current view: top level - clang/tools/extra/clangd - CodeComplete.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 0 1 0.0 %
Date: 2018-05-20 00:06:23 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===--- CodeComplete.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             : // Code completion provides suggestions for what the user might type next.
      11             : // After "std::string S; S." we might suggest members of std::string.
      12             : // Signature help describes the parameters of a function as you type them.
      13             : //
      14             : //===---------------------------------------------------------------------===//
      15             : #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
      16             : #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
      17             : 
      18             : #include "Headers.h"
      19             : #include "Logger.h"
      20             : #include "Path.h"
      21             : #include "Protocol.h"
      22             : #include "index/Index.h"
      23             : #include "clang/Frontend/PrecompiledPreamble.h"
      24             : #include "clang/Sema/CodeCompleteOptions.h"
      25             : #include "clang/Tooling/CompilationDatabase.h"
      26             : 
      27             : namespace clang {
      28             : class PCHContainerOperations;
      29             : namespace clangd {
      30             : 
      31           0 : struct CodeCompleteOptions {
      32             :   /// Returns options that can be passed to clang's completion engine.
      33             :   clang::CodeCompleteOptions getClangCompleteOpts() const;
      34             : 
      35             :   /// When true, completion items will contain expandable code snippets in
      36             :   /// completion (e.g.  `return ${1:expression}` or `foo(${1:int a}, ${2:int
      37             :   /// b})).
      38             :   bool EnableSnippets = false;
      39             : 
      40             :   /// Add code patterns to completion results.
      41             :   /// If EnableSnippets is false, this options is ignored and code patterns will
      42             :   /// always be omitted.
      43             :   bool IncludeCodePatterns = true;
      44             : 
      45             :   /// Add macros to code completion results.
      46             :   bool IncludeMacros = true;
      47             : 
      48             :   /// Add comments to code completion results, if available.
      49             :   bool IncludeComments = true;
      50             : 
      51             :   /// Include results that are not legal completions in the current context.
      52             :   /// For example, private members are usually inaccessible.
      53             :   bool IncludeIneligibleResults = false;
      54             : 
      55             :   /// Limit the number of results returned (0 means no limit).
      56             :   /// If more results are available, we set CompletionList.isIncomplete.
      57             :   size_t Limit = 0;
      58             : 
      59             :   // Populated internally by clangd, do not set.
      60             :   /// If `Index` is set, it is used to augment the code completion
      61             :   /// results.
      62             :   /// FIXME(ioeric): we might want a better way to pass the index around inside
      63             :   /// clangd.
      64             :   const SymbolIndex *Index = nullptr;
      65             : };
      66             : 
      67             : /// Get code completions at a specified \p Pos in \p FileName.
      68             : CompletionList codeComplete(PathRef FileName,
      69             :                             const tooling::CompileCommand &Command,
      70             :                             PrecompiledPreamble const *Preamble,
      71             :                             const std::vector<Inclusion> &PreambleInclusions,
      72             :                             StringRef Contents, Position Pos,
      73             :                             IntrusiveRefCntPtr<vfs::FileSystem> VFS,
      74             :                             std::shared_ptr<PCHContainerOperations> PCHs,
      75             :                             CodeCompleteOptions Opts);
      76             : 
      77             : /// Get signature help at a specified \p Pos in \p FileName.
      78             : SignatureHelp signatureHelp(PathRef FileName,
      79             :                             const tooling::CompileCommand &Command,
      80             :                             PrecompiledPreamble const *Preamble,
      81             :                             StringRef Contents, Position Pos,
      82             :                             IntrusiveRefCntPtr<vfs::FileSystem> VFS,
      83             :                             std::shared_ptr<PCHContainerOperations> PCHs);
      84             : 
      85             : } // namespace clangd
      86             : } // namespace clang
      87             : 
      88             : #endif

Generated by: LCOV version 1.13