Commit 379d3a01 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[debug-toolbar/display_source_code] add links to files in tracebacks

parent 3cbcbaead477
......@@ -47,7 +47,7 @@
</tr>
<tr style="display: none" id="stack-${i}">
<td colspan="7">
<pre>${highlight(query["callstack"], "py3tb", linenos="inline") | n}</pre>
<pre>${source_code_url_in_stack(highlight(query["callstack"], "py3tb", linenos="inline"), highlighted=has_pygments) | n}</pre>
</td>
</tr>
<tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
......
......@@ -29,7 +29,7 @@
</tr>
<tr style="display: none" id="sql-stack-${i}">
<td colspan="6">
<pre>${highlight(query["callstack"], "py3tb", linenos="inline") | n}</pre>
<pre>${source_code_url_in_stack(highlight(query["callstack"], "py3tb", linenos="inline"), highlighted=has_pygments) | n}</pre>
</td>
</tr>
<tr style="display: none"></tr> <!-- css hack because of previous hidden tr for -stripped -->
......
......@@ -19,7 +19,8 @@
from pyramid_debugtoolbar.panels import DebugPanel
from cubicweb.debug import subscribe_to_debug_channel, unsubscribe_to_debug_channel
from cubicweb.misc.source_highlight import highlight_html, generate_css
from cubicweb.misc.source_highlight import highlight_html, generate_css, has_pygments
from cubicweb.pyramid.debug_source_code import source_code_url, source_code_url_in_stack
class CubicWebDebugPanel(DebugPanel):
......@@ -169,6 +170,8 @@ class RQLDebugPanel(DebugPanel):
'sql_queries': [],
'highlight': highlight_html,
'generate_css': generate_css,
'has_pygments': has_pygments,
'source_code_url_in_stack': source_code_url_in_stack,
}
subscribe_to_debug_channel("rql", self.collect_rql_queries)
subscribe_to_debug_channel("sql", self.collect_sql_queries)
......@@ -225,6 +228,8 @@ class SQLDebugPanel(DebugPanel):
'sql_queries': [],
'highlight': highlight_html,
'generate_css': generate_css,
'has_pygments': has_pygments,
'source_code_url_in_stack': source_code_url_in_stack,
}
subscribe_to_debug_channel("rql", self.collect_rql_queries)
subscribe_to_debug_channel("sql", self.collect_sql_queries)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment