clang-tools 22.0.0git
|
Wraps another compilation database, and supports overriding the commands using an in-memory mapping. More...
#include <GlobalCompilationDatabase.h>
Public Types | |
using | CommandMangler |
Public Types inherited from clang::clangd::GlobalCompilationDatabase | |
using | CommandChanged = Event<std::vector<std::string>> |
Public Member Functions | |
OverlayCDB (const GlobalCompilationDatabase *Base, std::vector< std::string > FallbackFlags={}, CommandMangler Mangler=nullptr) | |
std::optional< tooling::CompileCommand > | getCompileCommand (PathRef File) const override |
If there are any known-good commands for building this file, returns one. | |
tooling::CompileCommand | getFallbackCommand (PathRef File) const override |
Makes a guess at how to build a file. | |
bool | setCompileCommand (PathRef File, std::optional< tooling::CompileCommand > CompilationCommand) |
Sets or clears the compilation command for a particular file. | |
std::unique_ptr< ProjectModules > | getProjectModules (PathRef File) const override |
Get the modules in the closest project to File . | |
Public Member Functions inherited from clang::clangd::DelegatingCDB | |
DelegatingCDB (const GlobalCompilationDatabase *Base) | |
DelegatingCDB (std::unique_ptr< GlobalCompilationDatabase > Base) | |
std::optional< ProjectInfo > | getProjectInfo (PathRef File) const override |
Finds the closest project to File . | |
bool | blockUntilIdle (Deadline D) const override |
If the CDB does any asynchronous work, wait for it to complete. | |
Public Member Functions inherited from clang::clangd::GlobalCompilationDatabase | |
virtual | ~GlobalCompilationDatabase ()=default |
CommandChanged::Subscription | watch (CommandChanged::Listener L) const |
The callback is notified when files may have new compile commands. |
Additional Inherited Members | |
Protected Attributes inherited from clang::clangd::GlobalCompilationDatabase | |
CommandChanged | OnCommandChanged |
Wraps another compilation database, and supports overriding the commands using an in-memory mapping.
Definition at line 187 of file GlobalCompilationDatabase.h.
Definition at line 191 of file GlobalCompilationDatabase.h.
clang::clangd::OverlayCDB::OverlayCDB | ( | const GlobalCompilationDatabase * | Base, |
std::vector< std::string > | FallbackFlags = {}, | ||
CommandMangler | Mangler = nullptr ) |
Definition at line 760 of file GlobalCompilationDatabase.cpp.
References clang::clangd::DelegatingCDB::DelegatingCDB().
|
overridevirtual |
If there are any known-good commands for building this file, returns one.
Reimplemented from clang::clangd::DelegatingCDB.
Definition at line 767 of file GlobalCompilationDatabase.cpp.
References clang::clangd::File, clang::clangd::DelegatingCDB::getCompileCommand(), and clang::clangd::removeDots().
|
overridevirtual |
Makes a guess at how to build a file.
The default implementation just runs clang on the file. Clangd should treat the results as unreliable.
Reimplemented from clang::clangd::DelegatingCDB.
Definition at line 800 of file GlobalCompilationDatabase.cpp.
References clang::clangd::File, and clang::clangd::DelegatingCDB::getFallbackCommand().
|
overridevirtual |
Get the modules in the closest project to File
.
Reimplemented from clang::clangd::DelegatingCDB.
Definition at line 834 of file GlobalCompilationDatabase.cpp.
References clang::clangd::File, clang::clangd::DelegatingCDB::getProjectModules(), and clang::clangd::log().
bool clang::clangd::OverlayCDB::setCompileCommand | ( | PathRef | File, |
std::optional< tooling::CompileCommand > | CompilationCommand ) |
Sets or clears the compilation command for a particular file.
Returns true if the command was changed (including insertion and removal), false if it was unchanged.
Definition at line 810 of file GlobalCompilationDatabase.cpp.
References clang::clangd::File, clang::clangd::GlobalCompilationDatabase::OnCommandChanged, and clang::clangd::removeDots().
Referenced by clang::clangd::TEST_F(), clang::clangd::TEST_F(), clang::clangd::TEST_F(), clang::clangd::TEST_F(), and clang::clangd::TEST_F().