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

LanguageServers/Cpp: Complete Preprocessor definitions

Preprocessor definitions now appear in the AutoComplete suggestions box
as well as in the Locator.
This commit is contained in:
Itamar 2021-03-13 09:50:33 +02:00 committed by Andreas Kling
parent 5b22f6f45a
commit 7bf6eca9d8
6 changed files with 26 additions and 2 deletions

View file

@ -86,6 +86,7 @@ public:
static GUI::Icon class_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Class.png"));
static GUI::Icon function_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Function.png"));
static GUI::Icon variable_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Variable.png"));
static GUI::Icon preprocessor_icon(Gfx::Bitmap::load_from_file("/res/icons/hackstudio/Preprocessor.png"));
switch (suggestion.as_symbol_declaration.value().type) {
case GUI::AutocompleteProvider::DeclarationType::Struct:
return struct_icon;
@ -95,6 +96,8 @@ public:
return function_icon;
case GUI::AutocompleteProvider::DeclarationType::Variable:
return variable_icon;
case GUI::AutocompleteProvider::DeclarationType::PreprocessorDefinition:
return preprocessor_icon;
}
return {};
}