diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibCpp/AST.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/AutocompleteProvider.h | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp index 9ef47ec73a..dd402047f5 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp @@ -486,6 +486,10 @@ GUI::AutocompleteProvider::DeclarationType ParserAutoComplete::type_of_declarati return GUI::AutocompleteProvider::DeclarationType::Function; if (decl.is_variable_declaration()) return GUI::AutocompleteProvider::DeclarationType::Variable; + if (decl.is_namespace()) + return GUI::AutocompleteProvider::DeclarationType::Namespace; + if (decl.is_member()) + return GUI::AutocompleteProvider::DeclarationType::Member; return GUI::AutocompleteProvider::DeclarationType::Variable; } diff --git a/Userland/Libraries/LibCpp/AST.h b/Userland/Libraries/LibCpp/AST.h index d2ada70b8a..3b2e595758 100644 --- a/Userland/Libraries/LibCpp/AST.h +++ b/Userland/Libraries/LibCpp/AST.h @@ -137,6 +137,7 @@ public: virtual bool is_class() const { return false; } virtual bool is_function() const { return false; } virtual bool is_namespace() const { return false; } + virtual bool is_member() const { return false; } const StringView& name() const { return m_name; } StringView m_name; @@ -529,6 +530,7 @@ public: virtual ~MemberDeclaration() override = default; virtual const char* class_name() const override { return "MemberDeclaration"; } virtual void dump(size_t indent) const override; + virtual bool is_member() const override { return true; } MemberDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename) : Declaration(parent, start, end, filename) diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.h b/Userland/Libraries/LibGUI/AutocompleteProvider.h index ca3290bd58..aed7a4d6d9 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.h +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.h @@ -69,6 +69,8 @@ public: Class, Variable, PreprocessorDefinition, + Namespace, + Member, }; struct Declaration { |