-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR Source Code window: configurable source highlighting #434
Comments
Do you have any insights how to add own syntax definitions for the AppImage? It seems just placing xml files in |
on my pc the definition files are in |
That would be very useful, especially for AppImage users who may not be able to write to this folder. |
please also first |
OK, checked with
Placing fresh files files from https://invent.kde.org/frameworks/syntax-highlighting/-/tree/master/data/syntax to I therefore consider nearly everything done here, the only part missing is the documentation (for the source code window in general [edit: that will be added with b6ad55d]). |
I don't quite get why one would want to edit the syntax files or provide custom ones? |
Outdated ones, hotspot works fine with RHEL7, which only has quite old ones, and if you can't install via yum and those aren't installed, then you have no syntax at all.
|
that's the real issue then - our ktexteditor that we bundle in the appimage should come with the up2date syntax declarations embedded as Qt resource files. if that's not working, then this is what should be fixed instead. |
Hm, where does it get those from and where are the QT resource files in the appimage? |
see https://invent.kde.org/frameworks/syntax-highlighting/-/blob/master/data/CMakeLists.txt the resource files are compiled directly into the code, in this case the syntax highlighting library from kde frameworks |
Thanks for the reference - does the AppImage uses master or a tag? |
master at the time I last built the docker image, see https://github.com/KDAB/hotspot/blob/master/scripts/appimage/Dockerfile |
Works fine. |
Hm, used the current appimage (from yesterday) on a RHEL7 machine (directly starting it), result: the syntax files were outdated (newer ones missing). To get those working I needed to manually get them as xml files and place it it the right (previously not existing) folder under $HOME, restart - new files available... And related (may be moved out to a separate issue): wouldn't it be useful to manually kick entries out of the list that are not executable (yaml, json, ... there are a bunch of those). |
@GitMensch please create a new task to track that. we might be missing some special flag when compiling the kf5 syntax highlighting framework to embed the data as RCC, unsure |
Is your feature request related to a problem? Please describe.
In some "rarer" cases the highlighter chooses the wrong syntax, it seems that this is all filename (extension) based now:
hotspot/src/models/sourcecodemodel.cpp
Lines 64 to 69 in fd2e8fd
Describe the solution you'd like
An option to change the language the highlighter uses, ideally also away to see what highlighter is used.
I'd suggest to add a footer line to the source window which has a label "syntax" and a drop down to choose between the available syntax (also showing which syntax is used). For performance reasons the list should only be created when the Disassembly View is opened the first time (or was closed).
Additional context
This is most likely to happen with preparsed files (bison/flex/embedded sql preprocessors/...) - and also with "uncommon" file extensions.
The text was updated successfully, but these errors were encountered: