Mahlet-Inc / hobbits

A multi-platform GUI for bit-based analysis, processing, and visualization
https://mahlet-inc.github.io
MIT License
660 stars 45 forks source link

Add a compilation option to use KTextEditor for a built-in KSY editor #125

Open KOLANICH opened 3 years ago

KOLANICH commented 3 years ago

https://api.kde.org/frameworks/ktexteditor/html/

It has syntax highlighting for yaml and blocks folding. One needs to set mode (not highlight mode, but just mode) into YAML

For Windows probanly QScintilla can be used, but for KDE, I guess, it may make sense to use KTextEditor

Obstacles:

  1. there is no libqt5xml5-dev package in Debian & Ubuntu. How have they built KF* packages without that? Debian bug
  2. It seems CMake doesn't properly discover KF packages. The workaround is to provide paths to their dirs, but it is extremily strange.
hello-adam commented 3 years ago

For a format as simple as YAML, it almost seems easier to just write a "mini-IDE" from scratch. That's probably dumb, but I might enjoy working on something like that for the fun/(rage).

KOLANICH commented 3 years ago

I am not sure that a custom IDE for YAML (I assumme that the IDE you mean is not going to be a text editor (because for a source code editor there are already existing components and apps doing everything needed from a source code editor), but something like YAML AST editor (sokething like bencode-editor, but for yaml)) will be more convenieht to use than a generic source code editor with YAML support. AST editor has too many states, and hitting wrong keys in wrong states will break the document semantics, reapairing which will be hard using the means such an editor provides. So, more cognitive load and more stress. A text editor provides a simple generic text interface, and the document being edited is just a text, not necessarily oje of correct syntax (an AST editor gurantees the correctness of syntax, a text editor doesn't), but at least the semantics is not garbled, and the syntax is the thing that is easy to fix.

Of course, this argument doesn't apply if "mini-IDE" means just a text editor with YAML support, but in this case an another argument applies. It is a yet another dependency, which would consume disk space and ram and is a burden to maintain and even develop to the quality of existing solutions powered by big projects and multiple people.

So the best you can do is to reuse the effort of these people.