@@ -97,7 +97,6 @@ static std::string print_type(const clang::TemplateTemplateParmDecl* TTP,
9797}
9898
9999static std::vector<HoverItem> get_hover_items (CompilationUnitRef unit,
100- >>>>>>> 7c3c815 (Refactor ut, misc patch on type deducing)
101100 const clang::NamedDecl* decl,
102101 const config::HoverOptions& opt) {
103102 clang::ASTContext& ctx = unit.context ();
@@ -196,19 +195,6 @@ static std::string get_source_code(CompilationUnitRef unit, clang::SourceRange r
196195 lo)};
197196}
198197
199- // Get all source code
200- static std::string get_source_code (CompilationUnitRef unit, clang::SourceRange range) {
201- clang::LangOptions lo;
202- auto & sm = unit.context ().getSourceManager ();
203- auto start_loc = sm.getSpellingLoc (range.getBegin ());
204- auto last_token_loc = sm.getSpellingLoc (range.getEnd ());
205- auto end_loc = clang::Lexer::getLocForEndOfToken (last_token_loc, 0 , sm, lo);
206- return std::string{clang::Lexer::getSourceText (
207- clang::CharSourceRange::getCharRange (clang::SourceRange{start_loc, end_loc}),
208- sm,
209- lo)};
210- }
211-
212198static clang::TemplateTypeParmTypeLoc getContainedAutoParamType (clang::TypeLoc TL) {
213199 if (auto QTL = TL.getAs <clang::QualifiedTypeLoc>())
214200 return getContainedAutoParamType (QTL.getUnqualifiedLoc ());
@@ -411,19 +397,6 @@ static std::optional<clang::QualType> getDeducedType(clang::ASTContext& ASTCtx,
411397 return V.DeducedType ;
412398}
413399
414- // Get all source code
415- static std::string get_source_code (CompilationUnitRef unit, clang::SourceRange range) {
416- clang::LangOptions lo;
417- auto & sm = unit.context ().getSourceManager ();
418- auto start_loc = sm.getSpellingLoc (range.getBegin ());
419- auto last_token_loc = sm.getSpellingLoc (range.getEnd ());
420- auto end_loc = clang::Lexer::getLocForEndOfToken (last_token_loc, 0 , sm, lo);
421- return std::string{clang::Lexer::getSourceText (
422- clang::CharSourceRange::getCharRange (clang::SourceRange{start_loc, end_loc}),
423- sm,
424- lo)};
425- }
426-
427400// TODO: How does clangd put together decl, name, scope and sometimes initialized value?
428401// ```
429402// // scope
0 commit comments