mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibJS: Consolidate exception function names and source ranges
Instead of storing the function names (in a badly named Vector<String>) and source ranges separately, consolidate them into a new struct: TracebackFrame. This makes it both easier to use now and easier to extend in the future. Unlike before we now keep each call frame's current node source range in the traceback frame next to the function name, meaning we can display line and column numbers outside of the VM and after the call stack is emptied.
This commit is contained in:
parent
0cf04d07aa
commit
97d49cb92b
5 changed files with 39 additions and 33 deletions
|
@ -35,7 +35,8 @@ void CellSyntaxHighlighter::rehighlight(const Palette& palette)
|
|||
false);
|
||||
|
||||
if (m_cell && m_cell->exception()) {
|
||||
auto range = m_cell->exception()->source_ranges().first();
|
||||
auto& traceback = m_cell->exception()->traceback();
|
||||
auto& range = traceback.first().source_range;
|
||||
GUI::TextRange text_range { { range.start.line - 1, range.start.column }, { range.end.line - 1, range.end.column - 1 } };
|
||||
m_client->spans().prepend(
|
||||
GUI::TextDocumentSpan {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue