1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

HackStudio: Make TODO entries clickable

Now you can click a TODO entry to set focus on that position of that
file.
This commit is contained in:
Federico Guerinoni 2021-06-01 23:54:55 +02:00 committed by Linus Groh
parent 935c7b2f4b
commit e0f1c237d2
15 changed files with 83 additions and 39 deletions

View file

@ -8,6 +8,7 @@
#include <AK/String.h>
#include <AK/Types.h>
#include <LibCpp/Parser.h>
#include <LibGUI/AutocompleteProvider.h>
#include <LibIPC/Decoder.h>
#include <LibIPC/Encoder.h>
@ -102,4 +103,33 @@ inline bool decode(Decoder& decoder, GUI::AutocompleteProvider::Declaration& dec
return true;
}
template<>
inline bool encode(Encoder& encoder, Cpp::Parser::TodoEntry const& entry)
{
encoder << entry.content;
encoder << entry.filename;
encoder << (u64)entry.line;
encoder << (u64)entry.column;
return true;
}
template<>
inline bool decode(Decoder& decoder, Cpp::Parser::TodoEntry& entry)
{
u64 line = 0;
u64 column = 0;
if (!decoder.decode(entry.content))
return false;
if (!decoder.decode(entry.filename))
return false;
if (!decoder.decode(line))
return false;
if (!decoder.decode(column))
return false;
entry.line = line;
entry.column = column;
return true;
}
}