mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LanguageServers/Cpp: Add type to Declarations
This commit is contained in:
parent
4b483071fb
commit
71c7597130
Notes:
sideshowbarker
2024-07-18 21:52:57 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/71c7597130a Pull-request: https://github.com/SerenityOS/serenity/pull/5543 Issue: https://github.com/SerenityOS/serenity/issues/5478
2 changed files with 14 additions and 0 deletions
|
@ -97,6 +97,7 @@ inline bool encode(Encoder& encoder, const GUI::AutocompleteProvider::Declaratio
|
|||
encoder << declaration.name;
|
||||
if (!encode(encoder, declaration.position))
|
||||
return false;
|
||||
encoder << (u32)declaration.type;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -108,6 +109,11 @@ inline bool decode(Decoder& decoder, GUI::AutocompleteProvider::Declaration& dec
|
|||
|
||||
if (!decode(decoder, declaration.position))
|
||||
return false;
|
||||
u32 type;
|
||||
if (!decoder.decode( type))
|
||||
return false;
|
||||
|
||||
declaration.type = static_cast<GUI::AutocompleteProvider::DeclarationType>(type);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,9 +62,17 @@ public:
|
|||
size_t column { 0 };
|
||||
};
|
||||
|
||||
enum class DeclarationType {
|
||||
Function,
|
||||
Struct,
|
||||
Class,
|
||||
Variable
|
||||
};
|
||||
|
||||
struct Declaration {
|
||||
String name;
|
||||
ProjectLocation position;
|
||||
DeclarationType type;
|
||||
};
|
||||
|
||||
virtual void provide_completions(Function<void(Vector<Entry>)>) = 0;
|
||||
|
|
Loading…
Reference in a new issue