Lines Matching defs:File

157   void onFileUpdated(PathRef File, const TUStatus &Status) override {
159 ServerCallbacks->onFileUpdated(File, Status);
162 void onPreamblePublished(PathRef File) override {
164 ServerCallbacks->onSemanticsMaybeChanged(File);
265 [&CDB](llvm::StringRef File) { return CDB.getProjectInfo(File); }),
297 void ClangdServer::addDocument(PathRef File, llvm::StringRef Contents,
300 std::string ActualVersion = DraftMgr.addDraft(File, Version, Contents);
316 bool NewFile = WorkScheduler->update(File, Inputs, WantDiags);
319 BackgroundIdx->boostRelated(File);
323 llvm::function_ref<bool(llvm::StringRef File)> Filter) {
332 std::shared_ptr<const std::string> ClangdServer::getDraft(PathRef File) const {
333 auto Draft = DraftMgr.getDraft(File);
353 Context operator()(llvm::StringRef File) {
360 if (!File.empty()) {
361 assert(llvm::sys::path::is_absolute(File));
362 llvm::sys::path::native(File, PosixPath, llvm::sys::path::Style::posix);
416 void ClangdServer::removeDocument(PathRef File) {
417 DraftMgr.removeDraft(File);
418 WorkScheduler->remove(File);
421 void ClangdServer::codeComplete(PathRef File, Position Pos,
429 auto Task = [Pos, CodeCompleteOpts, File = File.str(), CB = std::move(CB),
440 vlog("Build for file {0} is not ready. Enter fallback mode.", File);
445 SpecFuzzyFind->CachedReq = CachedCompletionFuzzyFindRequestByFile[File];
461 File, Pos, IP->Preamble, ParseInput, CodeCompleteOpts,
469 CachedCompletionFuzzyFindRequestByFile[File] = *SpecFuzzyFind->NewReq;
479 "CodeComplete", File,
486 void ClangdServer::signatureHelp(PathRef File, Position Pos,
490 auto Action = [Pos, File = File.str(), CB = std::move(CB),
506 CB(clangd::signatureHelp(File, Pos, *PreambleData, ParseInput,
511 WorkScheduler->runWithPreamble("SignatureHelp", File, TUScheduler::Stale,
515 void ClangdServer::formatFile(PathRef File, std::optional<Range> Rng,
517 auto Code = getDraft(File);
535 auto Action = [File = File.str(), Code = std::move(*Code),
538 format::FormatStyle Style = getFormatStyleForFile(File, Code, TFS, true);
540 format::sortIncludes(Style, Code, Ranges, File);
548 File)));
550 WorkScheduler->runQuick("Format", File, std::move(Action));
553 void ClangdServer::formatOnType(PathRef File, Position Pos,
556 auto Code = getDraft(File);
563 auto Action = [File = File.str(), Code = std::move(*Code),
566 auto Style = getFormatStyleForFile(File, Code, TFS, false);
573 WorkScheduler->runQuick("FormatOnType", File, std::move(Action));
576 void ClangdServer::prepareRename(PathRef File, Position Pos,
580 auto Action = [Pos, File = File.str(), CB = std::move(CB),
589 InpAST->AST, File, /*FS=*/nullptr,
599 WorkScheduler->runWithAST("PrepareRename", File, std::move(Action));
602 void ClangdServer::rename(PathRef File, Position Pos, llvm::StringRef NewName,
605 auto Action = [File = File.str(), NewName = NewName.str(), Pos, Opts,
613 auto R = clangd::rename({Pos, NewName, InpAST->AST, File,
619 auto Style = getFormatStyleForFile(File, InpAST->Inputs.Contents,
632 WorkScheduler->runWithAST("Rename", File, std::move(Action));
738 WorkScheduler->runWithAST("codeAction", Params.File, std::move(Action),
742 void ClangdServer::applyTweak(PathRef File, Range Sel, StringRef TweakID,
751 auto Action = [File = File.str(), Sel, TweakID = TweakID.str(),
777 getFormatStyleForFile(File, E.InitialCode, TFS, false);
786 WorkScheduler->runWithAST("ApplyTweak", File, std::move(Action));
789 void ClangdServer::locateSymbolAt(PathRef File, Position Pos,
798 WorkScheduler->runWithAST("Definitions", File, std::move(Action));
822 PathRef File, Position Pos, Callback<std::vector<DocumentHighlight>> CB) {
830 WorkScheduler->runWithAST("Highlights", File, std::move(Action), Transient);
833 void ClangdServer::findHover(PathRef File, Position Pos,
835 auto Action = [File = File.str(), Pos, CB = std::move(CB),
840 File, InpAST->Inputs.Contents, *InpAST->Inputs.TFS, false);
844 WorkScheduler->runWithAST("Hover", File, std::move(Action), Transient);
847 void ClangdServer::typeHierarchy(PathRef File, Position Pos, int Resolve,
850 auto Action = [File = File.str(), Pos, Resolve, Direction, CB = std::move(CB),
855 File));
858 WorkScheduler->runWithAST("TypeHierarchy", File, std::move(Action));
888 PathRef File, Position Pos, Callback<std::vector<CallHierarchyItem>> CB) {
889 auto Action = [File = File.str(), Pos,
893 CB(clangd::prepareCallHierarchy(InpAST->AST, Pos, File));
895 WorkScheduler->runWithAST("CallHierarchy", File, std::move(Action));
907 void ClangdServer::inlayHints(PathRef File, std::optional<Range> RestrictRange,
915 WorkScheduler->runWithAST("InlayHints", File, std::move(Action), Transient);
943 void ClangdServer::documentSymbols(llvm::StringRef File,
951 WorkScheduler->runWithAST("DocumentSymbols", File, std::move(Action),
955 void ClangdServer::foldingRanges(llvm::StringRef File,
957 auto Code = getDraft(File);
968 WorkScheduler->runQuick("FoldingRanges", File, std::move(Action));
971 void ClangdServer::findType(llvm::StringRef File, Position Pos,
979 WorkScheduler->runWithAST("FindType", File, std::move(Action));
983 PathRef File, Position Pos, Callback<std::vector<LocatedSymbol>> CB) {
991 WorkScheduler->runWithAST("Implementations", File, std::move(Action));
994 void ClangdServer::findReferences(PathRef File, Position Pos, uint32_t Limit,
1004 WorkScheduler->runWithAST("References", File, std::move(Action));
1007 void ClangdServer::symbolInfo(PathRef File, Position Pos,
1016 WorkScheduler->runWithAST("SymbolInfo", File, std::move(Action));
1019 void ClangdServer::semanticRanges(PathRef File,
1035 WorkScheduler->runWithAST("SemanticRanges", File, std::move(Action));
1038 void ClangdServer::documentLinks(PathRef File,
1046 WorkScheduler->runWithAST("DocumentLinks", File, std::move(Action),
1051 PathRef File, Callback<std::vector<HighlightingToken>> CB) {
1063 WorkScheduler->runWithAST("SemanticHighlights", File, std::move(Action),
1067 void ClangdServer::getAST(PathRef File, std::optional<Range> R,
1103 WorkScheduler->runWithAST("GetAST", File, std::move(Action));
1106 void ClangdServer::customAction(PathRef File, llvm::StringRef Name,
1108 WorkScheduler->runWithAST(Name, File, std::move(Action));
1111 void ClangdServer::diagnostics(PathRef File, Callback<std::vector<Diag>> CB) {
1119 WorkScheduler->runWithAST("Diagnostics", File, std::move(Action));