@@ -150,6 +150,8 @@ ClangdServer::ClangdServer(const GlobalCompilationDatabase &CDB,
150
150
DynamicIdx (Opts.BuildDynamicSymbolIndex ? new FileIndex() : nullptr),
151
151
ClangTidyProvider(Opts.ClangTidyProvider),
152
152
WorkspaceRoot(Opts.WorkspaceRoot),
153
+ Transient(Opts.ImplicitCancellation ? TUScheduler::InvalidateOnUpdate
154
+ : TUScheduler::NoInvalidation),
153
155
DirtyFS(std::make_unique<DraftStoreFS>(TFS, DraftMgr)) {
154
156
// Pass a callback into `WorkScheduler` to extract symbols from a newly
155
157
// parsed file and rebuild the file index synchronously each time an AST
@@ -593,7 +595,7 @@ void ClangdServer::enumerateTweaks(
593
595
};
594
596
595
597
WorkScheduler->runWithAST (" EnumerateTweaks" , File, std::move (Action),
596
- TUScheduler::InvalidateOnUpdate );
598
+ Transient );
597
599
}
598
600
599
601
void ClangdServer::applyTweak (PathRef File, Range Sel, StringRef TweakID,
@@ -683,8 +685,7 @@ void ClangdServer::findDocumentHighlights(
683
685
CB (clangd::findDocumentHighlights (InpAST->AST , Pos));
684
686
};
685
687
686
- WorkScheduler->runWithAST (" Highlights" , File, std::move (Action),
687
- TUScheduler::InvalidateOnUpdate);
688
+ WorkScheduler->runWithAST (" Highlights" , File, std::move (Action), Transient);
688
689
}
689
690
690
691
void ClangdServer::findHover (PathRef File, Position Pos,
@@ -698,8 +699,7 @@ void ClangdServer::findHover(PathRef File, Position Pos,
698
699
CB (clangd::getHover (InpAST->AST , Pos, std::move (Style ), Index));
699
700
};
700
701
701
- WorkScheduler->runWithAST (" Hover" , File, std::move (Action),
702
- TUScheduler::InvalidateOnUpdate);
702
+ WorkScheduler->runWithAST (" Hover" , File, std::move (Action), Transient);
703
703
}
704
704
705
705
void ClangdServer::typeHierarchy (PathRef File, Position Pos, int Resolve,
@@ -771,7 +771,7 @@ void ClangdServer::documentSymbols(llvm::StringRef File,
771
771
CB (clangd::getDocumentSymbols (InpAST->AST ));
772
772
};
773
773
WorkScheduler->runWithAST (" DocumentSymbols" , File, std::move (Action),
774
- TUScheduler::InvalidateOnUpdate );
774
+ Transient );
775
775
}
776
776
777
777
void ClangdServer::foldingRanges (llvm::StringRef File,
@@ -783,7 +783,7 @@ void ClangdServer::foldingRanges(llvm::StringRef File,
783
783
CB (clangd::getFoldingRanges (InpAST->AST ));
784
784
};
785
785
WorkScheduler->runWithAST (" FoldingRanges" , File, std::move (Action),
786
- TUScheduler::InvalidateOnUpdate );
786
+ Transient );
787
787
}
788
788
789
789
void ClangdServer::findImplementations (
@@ -850,7 +850,7 @@ void ClangdServer::documentLinks(PathRef File,
850
850
CB (clangd::getDocumentLinks (InpAST->AST ));
851
851
};
852
852
WorkScheduler->runWithAST (" DocumentLinks" , File, std::move (Action),
853
- TUScheduler::InvalidateOnUpdate );
853
+ Transient );
854
854
}
855
855
856
856
void ClangdServer::semanticHighlights (
@@ -862,7 +862,7 @@ void ClangdServer::semanticHighlights(
862
862
CB (clangd::getSemanticHighlightings (InpAST->AST ));
863
863
};
864
864
WorkScheduler->runWithAST (" SemanticHighlights" , File, std::move (Action),
865
- TUScheduler::InvalidateOnUpdate );
865
+ Transient );
866
866
}
867
867
868
868
void ClangdServer::getAST (PathRef File, Range R,
0 commit comments