mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 03:55:49 +00:00
Cleanup
This commit is contained in:
parent
6acea187c7
commit
bc28bfef45
@ -39,7 +39,7 @@ bool ClangType::is_fundamental() const {
|
||||
cx_type.kind <= CXType_LastBuiltin;
|
||||
}
|
||||
|
||||
CXCursor ClangType::get_declaration() const {
|
||||
ClangCursor ClangType::get_declaration() const {
|
||||
return clang_getTypeDeclaration(cx_type);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@ using Usr = uint64_t;
|
||||
Range ResolveCXSourceRange(const CXSourceRange& range,
|
||||
CXFile* cx_file = nullptr);
|
||||
|
||||
class ClangCursor;
|
||||
|
||||
class ClangType {
|
||||
public:
|
||||
ClangType();
|
||||
@ -24,8 +26,7 @@ class ClangType {
|
||||
// Returns true if this is a fundamental type like int.
|
||||
bool is_fundamental() const;
|
||||
|
||||
// ClangCursor is not defined so we have to return CXCursor
|
||||
CXCursor get_declaration() const;
|
||||
ClangCursor get_declaration() const;
|
||||
std::string get_usr() const;
|
||||
Usr get_usr_hash() const;
|
||||
std::string get_spelling() const;
|
||||
|
@ -414,8 +414,7 @@ optional<IndexTypeId> ResolveToDeclarationType(IndexFile* db,
|
||||
}
|
||||
|
||||
ClangCursor declaration =
|
||||
ClangCursor(type.get_declaration())
|
||||
.template_specialization_to_template_definition();
|
||||
type.get_declaration().template_specialization_to_template_definition();
|
||||
CXString cx_usr = clang_getCursorUSR(declaration.cx_cursor);
|
||||
const char* str_usr = clang_getCString(cx_usr);
|
||||
if (!str_usr || str_usr[0] == '\0') {
|
||||
|
@ -77,7 +77,9 @@ struct InitializeHandler : BaseMessageHandler<Ipc_InitializeRequest> {
|
||||
}
|
||||
g_index_builtin_types = config->index.builtin_types;
|
||||
// TODO Remove enableComments
|
||||
g_enable_comments = std::max(config->enableComments, config->index.comments);
|
||||
if (config->index.comments > 0)
|
||||
config->enableComments = config->index.comments;
|
||||
g_enable_comments = config->enableComments;
|
||||
|
||||
// Check client version.
|
||||
if (config->clientVersion.has_value() &&
|
||||
|
@ -262,7 +262,7 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
|
||||
|
||||
// Using -fparse-all-comments enables documententation in the indexer and in
|
||||
// code completion.
|
||||
if (init_opts->enableComments > 1 &&
|
||||
if (init_opts->index.comments > 1 &&
|
||||
!AnyStartsWith(result.args, "-fparse-all-comments")) {
|
||||
result.args.push_back("-fparse-all-comments");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user