binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Integrate better text editor

Open psifertex opened this issue 9 years ago • 5 comments

From @psifertex on May 5, 2015 14:7

Copied from original issue: Vector35/binaryninja#13

psifertex avatar Nov 05 '15 00:11 psifertex

monaco is looking pretty attractive.

psifertex avatar Jul 15 '17 22:07 psifertex

Line numbers in "Assemble" window and "Compile C Source" would be good, just to call out one specific feature.

ElykDeer avatar Oct 02 '20 05:10 ElykDeer

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. Uses QWebEngineView to load a custom web page containing an instance of monaco.

        • 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

0xdevalias avatar May 06 '24 05:05 0xdevalias

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 avatar May 06 '24 06:05 psifertex

@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.

0xdevalias avatar May 06 '24 09:05 0xdevalias