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

Spreadsheet: Display a detailed view of a cell error on hover

With this, Spreadsheet can now show an almost full stack trace for the
error (which is infintely better than just the error message).
This commit is contained in:
Ali Mohammad Pur 2022-06-26 00:12:23 +04:30 committed by Linus Groh
parent 64ef808aeb
commit db4a5aafc8
6 changed files with 62 additions and 1 deletions

View file

@ -50,6 +50,15 @@ struct Cell : public Weakable<Cell> {
bool dirty() const { return m_dirty; }
void clear_dirty() { m_dirty = false; }
StringView name_for_javascript(Sheet const& sheet) const
{
if (!m_name_for_javascript.is_empty())
return m_name_for_javascript;
m_name_for_javascript = String::formatted("cell {}", m_position.to_cell_identifier(sheet));
return m_name_for_javascript;
}
void set_thrown_value(JS::Value value) { m_thrown_value = value; }
Optional<JS::Value> thrown_value() const
{
@ -116,6 +125,7 @@ private:
CellType const* m_type { nullptr };
CellTypeMetadata m_type_metadata;
Position m_position;
mutable String m_name_for_javascript;
Vector<ConditionalFormat> m_conditional_formats;
Format m_evaluated_formats;