Port SelectionTree from clangd to clice (#166)

This commit is contained in:
ykiko
2025-08-05 22:10:08 +08:00
committed by GitHub
parent 139eaa44f7
commit 072ddb3a59
25 changed files with 2419 additions and 1182 deletions

View File

@@ -41,6 +41,7 @@ struct HoverItem {
struct Hover {
/// Title
SymbolKind kind;
std::string name;
/// Extra information.
@@ -56,28 +57,11 @@ struct Hover {
std::string source;
};
/// Hover information for all symbols in the file.
struct Hovers {
struct Occurrence {
LocalSourceRange range;
uint32_t index;
};
/// Hover information for all symbols in the file.
std::vector<Hover> hovers;
/// A map between the file offset and the index of the hover.
std::vector<Occurrence> occurrences;
};
/// Generate the hover information for the given declaration(for test).
Hover hover(CompilationUnit& unit, const clang::NamedDecl* decl);
/// Generate the hover information for the symbol at the given offset.
Hover hover(CompilationUnit& unit, uint32_t offset);
/// Generate the hover information for all files in the given unit.
index::Shared<Hovers> indexHover(CompilationUnit& unit);
Hover hover(CompilationUnit& unit, std::uint32_t offset);
} // namespace clice::feature