31 #include "clang/Format/Format.h" 32 #include "clang/Frontend/CompilerInstance.h" 33 #include "clang/Frontend/CompilerInvocation.h" 34 #include "clang/Lex/Preprocessor.h" 35 #include "clang/Tooling/CompilationDatabase.h" 36 #include "clang/Tooling/Core/Replacement.h" 37 #include "llvm/ADT/ArrayRef.h" 38 #include "llvm/ADT/Optional.h" 39 #include "llvm/ADT/STLExtras.h" 40 #include "llvm/ADT/ScopeExit.h" 41 #include "llvm/ADT/StringRef.h" 42 #include "llvm/Support/Errc.h" 43 #include "llvm/Support/Error.h" 44 #include "llvm/Support/FileSystem.h" 45 #include "llvm/Support/Path.h" 46 #include "llvm/Support/raw_ostream.h" 51 #include <type_traits> 58 struct UpdateIndexCallbacks :
public ParsingCallbacks {
59 UpdateIndexCallbacks(FileIndex *FIndex, DiagnosticsConsumer &
DiagConsumer,
60 bool SemanticHighlighting)
61 : FIndex(FIndex), DiagConsumer(DiagConsumer),
62 SemanticHighlighting(SemanticHighlighting) {}
65 std::shared_ptr<clang::Preprocessor>
PP,
66 const CanonicalIncludes &CanonIncludes)
override {
68 FIndex->updatePreamble(Path, Ctx, std::move(PP), CanonIncludes);
71 void onMainAST(
PathRef Path, ParsedAST &
AST, PublishFn Publish)
override {
73 FIndex->updateMain(Path, AST);
75 std::vector<Diag> Diagnostics = AST.getDiagnostics();
76 std::vector<HighlightingToken> Highlightings;
77 if (SemanticHighlighting)
81 DiagConsumer.onDiagnosticsReady(Path, std::move(Diagnostics));
82 if (SemanticHighlighting)
83 DiagConsumer.onHighlightingsReady(Path, std::move(Highlightings));
87 void onFailedAST(
PathRef Path, std::vector<Diag> Diags,
88 PublishFn Publish)
override {
89 Publish([&]() {
DiagConsumer.onDiagnosticsReady(Path, Diags); });
92 void onFileUpdated(
PathRef File,
const TUStatus &Status)
override {
99 bool SemanticHighlighting;
105 Opts.
UpdateDebounce = std::chrono::steady_clock::duration::zero();
116 : FSProvider(FSProvider),
117 DynamicIdx(Opts.BuildDynamicSymbolIndex
118 ? new
FileIndex(Opts.HeavyweightDynamicSymbolIndex)
120 GetClangTidyOptions(Opts.GetClangTidyOptions),
121 SuggestMissingIncludes(Opts.SuggestMissingIncludes),
122 CrossFileRename(Opts.CrossFileRename), TweakFilter(Opts.TweakFilter),
123 WorkspaceRoot(Opts.WorkspaceRoot),
130 CDB, Opts.AsyncThreadsCount, Opts.StorePreamblesInMemory,
131 std::make_unique<UpdateIndexCallbacks>(DynamicIdx.get(), DiagConsumer,
132 Opts.SemanticHighlighting),
133 Opts.UpdateDebounce, Opts.RetentionPolicy) {
136 if (this->Index !=
nullptr) {
137 MergedIdx.push_back(std::make_unique<MergedIndex>(Idx, this->Index));
138 this->Index = MergedIdx.back().get();
146 BackgroundIdx = std::make_unique<BackgroundIndex>(
149 [&CDB](llvm::StringRef
File) {
return CDB.getProjectInfo(File); }),
151 AddIndex(BackgroundIdx.get());
154 AddIndex(DynamicIdx.get());
164 if (GetClangTidyOptions)
172 Inputs.
Opts = std::move(Opts);
173 Inputs.
Index = Index;
174 bool NewFile = WorkScheduler.
update(File, Inputs, WantDiags);
176 if (NewFile && BackgroundIdx)
177 BackgroundIdx->boostRelated(File);
190 auto CodeCompleteOpts = Opts;
191 if (!CodeCompleteOpts.Index)
192 CodeCompleteOpts.
Index = Index;
195 File = File.str(), CB = std::move(CB),
196 this](llvm::Expected<InputsAndPreamble> IP)
mutable {
198 return CB(IP.takeError());
200 return CB(llvm::make_error<CancelledError>());
202 llvm::Optional<SpeculativeFuzzyFind> SpecFuzzyFind;
206 vlog(
"Build for file {0} is not ready. Enter fallback mode.", File);
208 if (CodeCompleteOpts.Index && CodeCompleteOpts.SpeculativeIndexRequest) {
209 SpecFuzzyFind.emplace();
211 std::lock_guard<std::mutex> Lock(
212 CachedCompletionFuzzyFindRequestMutex);
213 SpecFuzzyFind->CachedReq =
214 CachedCompletionFuzzyFindRequestByFile[
File];
221 File, IP->Command, IP->Preamble, IP->Contents, Pos, FS,
222 CodeCompleteOpts, SpecFuzzyFind ? SpecFuzzyFind.getPointer() :
nullptr);
225 CB(std::move(Result));
227 if (SpecFuzzyFind && SpecFuzzyFind->NewReq.hasValue()) {
228 std::lock_guard<std::mutex> Lock(CachedCompletionFuzzyFindRequestMutex);
229 CachedCompletionFuzzyFindRequestByFile[
File] =
230 SpecFuzzyFind->NewReq.getValue();
240 "CodeComplete", File,
252 this](llvm::Expected<InputsAndPreamble> IP)
mutable {
254 return CB(IP.takeError());
269 llvm::Expected<tooling::Replacements>
273 return Begin.takeError();
276 return End.takeError();
277 return formatCode(Code, File, {
tooling::Range(*Begin, *End - *Begin)});
280 llvm::Expected<tooling::Replacements>
286 llvm::Expected<std::vector<TextEdit>>
288 StringRef TriggerText) {
291 return CursorPos.takeError();
293 auto Style = format::getStyle(format::DefaultFormatStyle, File,
294 format::DefaultFallbackStyle, Code,
FS.get());
296 return Style.takeError();
298 std::vector<TextEdit> Result;
299 for (
const tooling::Replacement &R :
306 Callback<llvm::Optional<Range>> CB) {
307 auto Action = [
Pos, File = File.str(), CB = std::move(CB),
308 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
310 return CB(InpAST.takeError());
311 auto &AST = InpAST->AST;
312 const auto &SM = AST.getSourceManager();
315 Pos, AST.getSourceManager(), AST.getLangOpts()));
333 return CB(
Changes.takeError());
344 auto Action = [File = File.str(), NewName = NewName.str(),
Pos, WantFormat,
345 CB = std::move(CB), Snapshot = std::move(Snapshot),
346 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
348 return CB(InpAST.takeError());
349 auto GetDirtyBuffer =
350 [&Snapshot](
PathRef AbsPath) -> llvm::Optional<std::string> {
351 auto It = Snapshot.find(AbsPath);
352 if (It == Snapshot.end())
357 CrossFileRename, GetDirtyBuffer});
359 return CB(Edits.takeError());
363 InpAST->Inputs.FS.get());
365 for (
auto &
E : *Edits)
367 llvm::joinErrors(
reformatEdit(
E.getValue(), Style), std::move(Err));
370 return CB(std::move(Err));
372 return CB(std::move(*Edits));
377 static llvm::Expected<Tweak::Selection>
381 return Begin.takeError();
384 return End.takeError();
389 Callback<std::vector<TweakRef>> CB) {
390 auto Action = [File = File.str(), Sel, CB = std::move(CB),
391 this](Expected<InputsAndAST> InpAST)
mutable {
393 return CB(InpAST.takeError());
396 return CB(Selection.takeError());
397 std::vector<TweakRef> Res;
399 Res.push_back({T->id(), T->title(), T->intent()});
410 [File = File.str(), Sel, TweakID = TweakID.str(), CB = std::move(CB),
411 FS = FSProvider.
getFileSystem()](Expected<InputsAndAST> InpAST)
mutable {
413 return CB(InpAST.takeError());
416 return CB(Selection.takeError());
419 return CB(A.takeError());
420 auto Effect = (*A)->apply(*Selection);
422 return CB(Effect.takeError());
423 for (
auto &It : Effect->ApplyEdits) {
428 elog(
"Failed to format {0}: {1}", It.first(), std::move(Err));
430 return CB(std::move(*Effect));
436 llvm::unique_function<
void(std::string)>
Callback) {
438 llvm::Expected<InputsAndAST> InpAST)
mutable {
440 llvm::consumeError(InpAST.takeError());
445 llvm::raw_string_ostream ResultOS(Result);
456 Callback<std::vector<LocatedSymbol>> CB) {
458 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
460 return CB(InpAST.takeError());
475 if (
auto CorrespondingFile =
477 return CB(std::move(CorrespondingFile));
478 auto Action = [Path = Path.str(), CB = std::move(CB),
479 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
481 return CB(InpAST.takeError());
487 llvm::Expected<tooling::Replacements>
488 ClangdServer::formatCode(llvm::StringRef
Code,
PathRef File,
489 llvm::ArrayRef<tooling::Range> Ranges) {
493 tooling::Replacements IncludeReplaces =
494 format::sortIncludes(Style, Code, Ranges, File);
495 auto Changed = tooling::applyAllReplacements(Code, IncludeReplaces);
499 return IncludeReplaces.merge(format::reformat(
501 tooling::calculateRangesAfterReplacements(IncludeReplaces, Ranges),
508 [
Pos, CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST)
mutable {
510 return CB(InpAST.takeError());
518 Callback<llvm::Optional<HoverInfo>> CB) {
519 auto Action = [File = File.str(),
Pos, CB = std::move(CB),
520 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
522 return CB(InpAST.takeError());
524 File, InpAST->Inputs.Contents, InpAST->Inputs.FS.get());
533 Callback<Optional<TypeHierarchyItem>> CB) {
534 auto Action = [File = File.str(),
Pos, Resolve, Direction, CB = std::move(CB),
535 this](Expected<InputsAndAST> InpAST)
mutable {
537 return CB(InpAST.takeError());
547 Callback<llvm::Optional<TypeHierarchyItem>> CB) {
558 llvm::StringRef Query,
int Limit,
559 Callback<std::vector<SymbolInformation>> CB) {
561 "getWorkspaceSymbols",
562 [Query = Query.str(),
Limit, CB = std::move(CB),
this]()
mutable {
564 WorkspaceRoot.getValueOr(
"")));
569 Callback<std::vector<DocumentSymbol>> CB) {
571 [CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST)
mutable {
573 return CB(InpAST.takeError());
582 this](llvm::Expected<InputsAndAST> InpAST)
mutable {
584 return CB(InpAST.takeError());
592 Callback<std::vector<SymbolDetails>> CB) {
594 [
Pos, CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST)
mutable {
596 return CB(InpAST.takeError());
606 [
Pos, CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST)
mutable {
608 return CB(InpAST.takeError());
615 Callback<std::vector<DocumentLink>> CB) {
617 [CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST)
mutable {
619 return CB(InpAST.takeError());
625 std::vector<std::pair<Path, std::size_t>>
634 BackgroundIdx->blockUntilIdleForTest(TimeoutSeconds));
SourceLocation Loc
'#' location in the include directive
WantDiagnostics
Determines whether diagnostics should be generated for a file snapshot.
std::vector< tooling::Replacement > formatIncremental(llvm::StringRef OriginalCode, unsigned OriginalCursor, llvm::StringRef InsertedText, format::FormatStyle Style)
Applies limited formatting around new InsertedText.
void addDocument(PathRef File, StringRef Contents, WantDiagnostics WD=WantDiagnostics::Auto)
Add a File to the list of tracked C++ files or update the contents if File is already tracked...
llvm::Expected< std::vector< SymbolInformation > > getWorkspaceSymbols(llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath)
Searches for the symbols matching Query.
void codeComplete(PathRef File, Position Pos, const clangd::CodeCompleteOptions &Opts, Callback< CodeCompleteResult > CB)
Run code completion for File at Pos.
Position start
The range's start position.
The preamble may be generated from an older version of the file.
void typeHierarchy(PathRef File, Position Pos, int Resolve, TypeHierarchyDirection Direction, Callback< llvm::Optional< TypeHierarchyItem >> CB)
Get information about type hierarchy for a given position.
bool BackgroundIndex
If true, ClangdServer automatically indexes files in the current project on background threads...
llvm::Expected< std::unique_ptr< Tweak > > prepareTweak(StringRef ID, const Tweak::Selection &S)
bool blockUntilIdle(Deadline D) const
Wait until there are no scheduled or running tasks.
std::vector< DocumentLink > getDocumentLinks(ParsedAST &AST)
Get all document links.
void remove(PathRef File)
Remove File from the list of tracked files and schedule removal of its resources. ...
void dumpAST(ParsedAST &AST, llvm::raw_ostream &OS)
For testing/debugging purposes.
void onFileEvent(const DidChangeWatchedFilesParams &Params)
Called when an event occurs for a watched file in the workspace.
void resolveTypeHierarchy(TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index)
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
static Factory createDiskBackedStorageFactory(std::function< llvm::Optional< ProjectInfo >(PathRef)> GetProjectInfo)
ClangdServer(const GlobalCompilationDatabase &CDB, const FileSystemProvider &FSProvider, DiagnosticsConsumer &DiagConsumer, const Options &Opts)
Creates a new ClangdServer instance.
This manages symbols from files and an in-memory index on all symbols.
Besides accepting stale preamble, this also allow preamble to be absent (not ready or failed to build...
SourceLocation getBeginningOfIdentifier(const Position &Pos, const SourceManager &SM, const LangOptions &LangOpts)
Get the beginning SourceLocation at a specified Pos in the main file.
bool SuggestMissingIncludes
llvm::StringRef PathRef
A typedef to represent a ref to file path.
llvm::unique_function< void(llvm::Expected< T >)> Callback
A Callback<T> is a void function that accepts Expected<T>.
LLVM_NODISCARD bool blockUntilIdleForTest(llvm::Optional< double > TimeoutSeconds=10)
ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index)
Returns references of the symbol at a specified Pos.
static Options optsForTest()
Documents should not be synced at all.
tidy::ClangTidyOptions ClangTidyOpts
void findDocumentHighlights(PathRef File, Position Pos, Callback< std::vector< DocumentHighlight >> CB)
Get document highlights for a given position.
unsigned AsyncThreadsCount
To process requests asynchronously, ClangdServer spawns worker threads.
void vlog(const char *Fmt, Ts &&... Vals)
bool update(PathRef File, ParseInputs Inputs, WantDiagnostics WD)
Schedule an update for File.
void elog(const char *Fmt, Ts &&... Vals)
void applyTweak(PathRef File, Range Sel, StringRef ID, Callback< Tweak::Effect > CB)
Apply the code tweak with a specified ID.
MockFSProvider FSProvider
static llvm::Expected< Tweak::Selection > tweakSelection(const Range &Sel, const InputsAndAST &AST)
SignatureHelp signatureHelp(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const SymbolIndex *Index)
bool isCancelled(const Context &Ctx)
True if the current context is within a cancelable task which was cancelled.
Provides compilation arguments used for parsing C and C++ files.
std::vector< SymbolDetails > getSymbolInfo(ParsedAST &AST, Position Pos)
Get info about symbols at Pos.
void documentLinks(PathRef File, Callback< std::vector< DocumentLink >> CB)
Get all document links in a file.
llvm::Optional< HoverInfo > getHover(ParsedAST &AST, Position Pos, format::FormatStyle Style, const SymbolIndex *Index)
Get the hover information when hovering at Pos.
Context clone() const
Clone this context object.
void resolveTypeHierarchy(TypeHierarchyItem Item, int Resolve, TypeHierarchyDirection Direction, Callback< llvm::Optional< TypeHierarchyItem >> CB)
Resolve type hierarchy item in the given direction.
llvm::Expected< size_t > positionToOffset(llvm::StringRef Code, Position P, bool AllowColumnsBeyondLineLength)
Turn a [line, column] pair into an offset in Code.
llvm::Expected< std::vector< TextEdit > > formatOnType(StringRef Code, PathRef File, Position Pos, StringRef TriggerText)
Run formatting after TriggerText was typed at Pos in File with content Code.
llvm::unique_function< void()> Action
std::string Path
A typedef to represent a file path.
static const Context & current()
Returns the context for the current thread, creating it if needed.
std::vector< std::pair< Path, std::size_t > > getUsedBytesPerFile() const
Returns estimated memory usage for each of the currently open files.
void runWithPreamble(llvm::StringRef Name, PathRef File, PreambleConsistency Consistency, Callback< InputsAndPreamble > Action)
Schedule an async read of the preamble.
enum clang::clangd::CodeCompleteOptions::CodeCompletionParse RunParser
void switchSourceHeader(PathRef Path, Callback< llvm::Optional< clangd::Path >> CB)
Switch to a corresponding source file when given a header file, and vice versa.
std::chrono::steady_clock::duration UpdateDebounce
Time to wait after a new file version before computing diagnostics.
llvm::Expected< std::vector< Range > > getSemanticRanges(ParsedAST &AST, Position Pos)
Returns the list of all interesting ranges around the Position Pos.
void dumpAST(PathRef File, llvm::unique_function< void(std::string)> Callback)
Only for testing purposes.
llvm::Optional< Range > getTokenRange(const SourceManager &SM, const LangOptions &LangOpts, SourceLocation TokLoc)
Returns the taken range at TokLoc.
void documentSymbols(StringRef File, Callback< std::vector< DocumentSymbol >> CB)
Retrieve the symbols within the specified file.
std::vector< DocumentHighlight > findDocumentHighlights(ParsedAST &AST, Position Pos)
Returns highlights for all usages of a symbol at Pos.
Input to prepare and apply tweaks.
std::vector< std::pair< Path, std::size_t > > getUsedBytesPerFile() const
Returns estimated memory usage for each of the currently open files.
format::FormatStyle getFormatStyleForFile(llvm::StringRef File, llvm::StringRef Content, llvm::vfs::FileSystem *FS)
Choose the clang-format style we should apply to a certain file.
void enumerateTweaks(PathRef File, Range Sel, Callback< std::vector< TweakRef >> CB)
Enumerate the code tweaks available to the user at a specified point.
CodeCompleteResult codeComplete(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind)
void findHover(PathRef File, Position Pos, Callback< llvm::Optional< HoverInfo >> CB)
Get code hover for a given position.
const SymbolIndex * Index
If Index is set, it is used to augment the code completion results.
llvm::Expected< tooling::Replacements > formatRange(StringRef Code, PathRef File, Range Rng)
Run formatting for Rng inside File with content Code.
Block until we can run the parser (e.g.
llvm::Optional< Path > getCorrespondingHeaderOrSource(const Path &OriginalFile, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS)
Given a header file, returns the best matching source file, and vice visa.
bool StorePreamblesInMemory
Cached preambles are potentially large. If false, store them on disk.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Deadline timeoutSeconds(llvm::Optional< double > Seconds)
Makes a deadline from a timeout in seconds. None means wait forever.
TextEdit replacementToEdit(llvm::StringRef Code, const tooling::Replacement &R)
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...
CharSourceRange Range
SourceRange for the file name.
llvm::Optional< TypeHierarchyItem > getTypeHierarchy(ParsedAST &AST, Position Pos, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index, PathRef TUPath)
Get type hierarchy information at Pos.
void removeDocument(PathRef File)
Remove File from list of tracked files, schedule a request to free resources associated with it...
void runWithAST(llvm::StringRef Name, PathRef File, Callback< InputsAndAST > Action)
Schedule an async read of the AST.
void prepareRename(PathRef File, Position Pos, Callback< llvm::Optional< Range >> CB)
Test the validity of a rename operation.
std::vector< HighlightingToken > getSemanticHighlightings(ParsedAST &AST)
llvm::StringRef getDocument(PathRef File) const
Get the contents of File, which should have been added.
void symbolInfo(PathRef File, Position Pos, Callback< std::vector< SymbolDetails >> CB)
Get symbol info for given position.
IgnoreDiagnostics DiagConsumer
void findReferences(PathRef File, Position Pos, uint32_t Limit, Callback< ReferencesResult > CB)
Retrieve locations for symbol references.
void locateSymbolAt(PathRef File, Position Pos, Callback< std::vector< LocatedSymbol >> CB)
Find declaration/definition locations of symbol at a specified position.
std::vector< LocatedSymbol > locateSymbolAt(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Get definition of symbol at a specified Pos.
void semanticRanges(PathRef File, Position Pos, Callback< std::vector< Range >> CB)
Get semantic ranges around a specified position in a file.
void rename(PathRef File, Position Pos, llvm::StringRef NewName, bool WantFormat, Callback< FileEdits > CB)
Rename all occurrences of the symbol at the Pos in File to NewName.
PrecompiledPreamble Preamble
static ClangTidyOptions getDefaults()
These options are used for all settings that haven't been overridden by the OptionsProvider.
llvm::Expected< FileEdits > rename(const RenameInputs &RInputs)
Renames all occurrences of the symbol.
Position end
The range's end position.
llvm::StringRef getContents(PathRef File) const
Returns the current contents of the buffer for File, per last update().
The parsed preamble and associated data.
Records an event whose duration is the lifetime of the Span object.
SymbolIndex * StaticIndex
If set, use this index to augment code completion results.
void workspaceSymbols(StringRef Query, int Limit, Callback< std::vector< SymbolInformation >> CB)
Retrieve the top symbols from the workspace matching a query.
llvm::Expected< tooling::Replacements > formatFile(StringRef Code, PathRef File)
Run formatting for the whole File with content Code.
void signatureHelp(PathRef File, Position Pos, Callback< SignatureHelp > CB)
Provide signature help for File at Pos.
A set of edits generated for a single file.
The preamble is generated from the current version of the file.
llvm::StringMap< std::string > getAllFileContents() const
Returns a snapshot of all file buffer contents, per last update().
llvm::Error reformatEdit(Edit &E, const format::FormatStyle &Style)
Formats the edits and code around it according to Style.
bool SemanticHighlighting
Enable semantic highlighting features.
std::vector< std::unique_ptr< Tweak > > prepareTweaks(const Tweak::Selection &S, llvm::function_ref< bool(const Tweak &)> Filter)
Calls prepare() on all tweaks that satisfy the filter, returning those that can run on the selection...
void run(llvm::StringRef Name, llvm::unique_function< void()> Action)
Schedule an async task with no dependencies.
static cl::opt< std::string > FormatStyle("format-style", cl::desc(R"(
Style for formatting code around applied fixes:
- 'none' (default) turns off formatting
- 'file' (literally 'file', not a placeholder)
uses .clang-format file in the closest parent
directory
- '{ <json> }' specifies options inline, e.g.
-format-style='{BasedOnStyle: llvm, IndentWidth: 8}'
- 'llvm', 'google', 'webkit', 'mozilla'
See clang-format documentation for the up-to-date
information about formatting styles and options.
This option overrides the 'FormatStyle` option in
.clang-tidy file, if any.
)"), cl::init("none"), cl::cat(ClangTidyCategory))
virtual llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > getFileSystem() const =0
Called by ClangdServer to obtain a vfs::FileSystem to be used for parsing.