binaryninja-api
binaryninja-api copied to clipboard
Integrate better text editor
From @psifertex on May 5, 2015 14:7
Copied from original issue: Vector35/binaryninja#13
monaco is looking pretty attractive.
Line numbers in "Assemble" window and "Compile C Source" would be good, just to call out one specific feature.
Curious if this is anywhere in mind for the 'nearish' (in a fairly hand wavy way) future? I suspect it would be a pretty big effort to implement it; but I can imagine so many powerful features that could come from being able to use something like monaco
as the base for the main code views/etc.
Edit: Saw on another issue (Ref) that the Binary Ninja UI is implemented in a mix of Qt/C++, it got me wondering if/how easy it would be to integrate monaco with that; which turned up the following on a quick google search (more for curiosity's sake than anything else):
- https://github.com/microsoft/monaco-editor/discussions/4192
-
C++ Qt Integration
-
- https://pypi.org/project/monaco-qt/
- https://github.com/DaelonSuzuka/monaco-qt
-
The
monaco
text editor deployed as a Qt Widget. UsesQWebEngineView
to load a custom web page containing an instance ofmonaco
.- https://doc.qt.io/qt-6/qwebengineview.html
-
QWebEngineView Class The QWebEngineView class provides a widget that is used to view and edit web documents.
-
- https://doc.qt.io/qt-6/qtwidgets-index.html
-
Qt Widgets
-
- https://doc.qt.io/qt-6/qwebengineview.html
-
- https://github.com/DaelonSuzuka/monaco-qt
The QWebEngine solution isn't an option unfortunately as we no longer embed it and it makes the install significantly bigger.
It's not on the immediate roadmap but I would sure like it too as it would improve the snippets plugin a ton.
That said, I suspect we will implement it eventually as we need it for something else in a core feature or if we find an implementation we can easily take advantage of.
@psifertex True true, that makes sense. Another (theoretical) method I found of embedding it was via CEF or similar; but presumably that would also massively add to the install size as well:
- https://github.com/chromiumembedded/cef
-
Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
-
I imagine it would take a decent bit of refactoring effort to do so, but I think having monaco
(or something equally as powerful) as the main 'Linear' panel view would unlock so many cool UX potentials.