Files
clice/include/Feature/DocumentSymbol.h
2025-06-15 15:13:09 +08:00

40 lines
937 B
C++

#pragma once
#include "Server/Protocol.h"
#include "AST/SourceCode.h"
#include "AST/SymbolKind.h"
#include "Index/Shared.h"
namespace clice::feature {
struct DocumentSymbol {
/// The range of symbol name in source code.
LocalSourceRange selectionRange;
/// The range of whole symbol.
LocalSourceRange range;
/// The symbol kind of this document symbol.
SymbolKind kind;
/// The symbol name.
std::string name;
/// Extra information about this symbol.
std::string detail;
/// The symbols that this symbol contains
std::vector<DocumentSymbol> children;
};
using DocumentSymbols = std::vector<DocumentSymbol>;
/// Generate document symbols for only interested file.
DocumentSymbols documentSymbols(CompilationUnit& unit);
/// Generate document symbols for all file in unit.
index::Shared<DocumentSymbols> indexDocumentSymbol(CompilationUnit& unit);
} // namespace clice::feature