Kate Symbol Viewer Plugin: Parse groovy Parse groovy files with the parseCppSymbols() - same as Java
I would like to have Symbols for my groovy files, but file type groovy is not supported:
What I found out is that if I rename my file from cfn.groovy
to cfn.java
the symbol viewer works just flawlessly:
Building Kate from Sources on Linux
sudo apt install cmake
sudo apt install ninja-build
sudo apt install libkf5i18n-dev
sudo apt install libkf5doctools-dev
sudo apt install libkf5texteditor-dev
sudo apt install libkf5newstuff-dev
sudo apt install libkf5threadweaver-dev
sudo apt install libkf5crash-dev libkf5activities-dev
sudo apt install libqt5widgets-dev
sudo apt install qt5widgets-dev
sudo apt install qtbase5-dev
kdesrc-build --initial-setup
My kdesrc-buildrc looks like this:
global
branch-group kf5-qt5
cmake-options -G "Kate - Ninja"
compile-commands-export yes
compile-commands-linking yes
kdedir ~/../GIT/kde/usr
source-dir ~/../GIT/kde/src
build-dir ~/../GIT/kde/build
end global
options kate
branch release/19.12
end options
include ~/../GIT/kdesrc-build/kf5-frameworks-build-include
include ~/../GIT/kdesrc-build/kf5-applications-build-include
include ~/../GIT/kdesrc-build/kf5-workspace-build-include
include ~/../GIT/kdesrc-build/kf5-extragear-build-include
first build vanilla master (that will fetch kate sources):
kdesrc-build --no-include-dependencies kate
find the file to change:
find /home/GIT -name plugin_katesymbolviewer.cpp
then navigate to kate repo
cd /home/GIT/kde/src/kde/applications/kate
checkout appropriate branch:
git checkout release/19.12
and make the changes
the rebuild without fetching from remote:
kdesrc-build --no-include-dependencies --no-src kate
Locate the upstream plugin binary:
dpkg -L kate | grep plugin
Locate the compiled plugin
find /home/GIT -name katesymbolviewerplugin.so
Backup the original plugin:
sudo mv /usr/lib/x86_64-linux-gnu/qt5/plugins/ktexteditor/katesymbolviewerplugin.so /usr/lib/x86_64-linux-gnu/qt5/plugins/ktexteditor/katesymbolviewerplugin.so.bak
Override the existing plugin:
sudo cp ./usr/lib/x86_64-linux-gnu/plugins/ktexteditor/katesymbolviewerplugin.so /usr/lib/x86_64-linux-gnu/qt5/plugins/ktexteditor/katesymbolviewerplugin.so