1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:17:34 +00:00

LanguageServers/Cpp: Autocomplete declarations from included headers

We now also look at the available declarations from included header
files when autocompleting names.

Additionally, you can now request autocomplete on an empty token, which
brings up all available names, starting from the inner-most scope.
This commit is contained in:
Itamar 2021-02-10 21:48:08 +02:00 committed by Andreas Kling
parent 64c80f6ea4
commit ef9bfbd383
4 changed files with 22 additions and 13 deletions

View file

@ -45,6 +45,7 @@ public:
Optional<Token> token_at(Position) const;
RefPtr<const TranslationUnit> root_node() const { return m_root_node; }
StringView text_of_node(const ASTNode&) const;
StringView text_of_token(const Cpp::Token& token) const;
void print_tokens() const;
Vector<String> errors() const { return m_errors; }
@ -127,7 +128,6 @@ private:
size_t token_index { 0 };
};
StringView text_of_token(const Cpp::Token& token);
void error(StringView message = {});
size_t node_span_size(const ASTNode& node) const;