clang-tools 20.0.0git
|
#include <TestFS.h>
Public Member Functions | |
MockCompilationDatabase (StringRef Directory=StringRef(), StringRef RelPathPrefix=StringRef()) | |
If Directory is not empty, use that as the Directory field of the CompileCommand, and as project SourceRoot. | |
std::optional< tooling::CompileCommand > | getCompileCommand (PathRef File) const override |
If there are any known-good commands for building this file, returns one. | |
std::optional< ProjectInfo > | getProjectInfo (PathRef File) const override |
Finds the closest project to File . | |
Public Member Functions inherited from clang::clangd::GlobalCompilationDatabase | |
virtual | ~GlobalCompilationDatabase ()=default |
virtual std::optional< tooling::CompileCommand > | getCompileCommand (PathRef File) const =0 |
If there are any known-good commands for building this file, returns one. | |
virtual std::optional< ProjectInfo > | getProjectInfo (PathRef File) const |
Finds the closest project to File . | |
virtual std::unique_ptr< ProjectModules > | getProjectModules (PathRef File) const |
Get the modules in the closest project to File . | |
virtual tooling::CompileCommand | getFallbackCommand (PathRef File) const |
Makes a guess at how to build a file. | |
virtual bool | blockUntilIdle (Deadline D) const |
If the CDB does any asynchronous work, wait for it to complete. | |
CommandChanged::Subscription | watch (CommandChanged::Listener L) const |
The callback is notified when files may have new compile commands. | |
Public Attributes | |
std::vector< std::string > | ExtraClangFlags |
Protected Attributes | |
StringRef | Directory |
StringRef | RelPathPrefix |
Protected Attributes inherited from clang::clangd::GlobalCompilationDatabase | |
CommandChanged | OnCommandChanged |
Additional Inherited Members | |
Public Types inherited from clang::clangd::GlobalCompilationDatabase | |
using | CommandChanged = Event< std::vector< std::string > > |
clang::clangd::MockCompilationDatabase::MockCompilationDatabase | ( | StringRef | Directory = StringRef() , |
StringRef | RelPathPrefix = StringRef() |
||
) |
If Directory
is not empty, use that as the Directory field of the CompileCommand, and as project SourceRoot.
If RelPathPrefix
is not empty, use that as a prefix in front of the source file name, instead of using an absolute path.
Definition at line 47 of file TestFS.cpp.
|
overridevirtual |
If there are any known-good commands for building this file, returns one.
Implements clang::clangd::GlobalCompilationDatabase.
Definition at line 60 of file TestFS.cpp.
References CommandLine, Directory, ExtraClangFlags, clang::clangd::File, FileName, and RelPathPrefix.
|
overridevirtual |
Finds the closest project to File
.
Reimplemented from clang::clangd::GlobalCompilationDatabase.
Definition at line 55 of file TestFS.cpp.
References Directory.
|
protected |
Definition at line 71 of file TestFS.h.
Referenced by getCompileCommand(), and getProjectInfo().
std::vector<std::string> clang::clangd::MockCompilationDatabase::ExtraClangFlags |
Definition at line 68 of file TestFS.h.
Referenced by getCompileCommand().
|
protected |
Definition at line 72 of file TestFS.h.
Referenced by getCompileCommand().