clang-tools 17.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 . | |
![]() | |
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 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 |
Additional Inherited Members | |
![]() | |
using | CommandChanged = Event< std::vector< std::string > > |
![]() | |
CommandChanged | OnCommandChanged |
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, ExtraClangFlags, clang::clangd::File, and FileName.
|
overridevirtual |
Finds the closest project to File
.
Reimplemented from clang::clangd::GlobalCompilationDatabase.
Definition at line 55 of file TestFS.cpp.
std::vector<std::string> clang::clangd::MockCompilationDatabase::ExtraClangFlags |
Definition at line 68 of file TestFS.h.
Referenced by getCompileCommand().