Should be nice to be able to add extra options to ctags command for some projects. For example, in a my use case I have a bash project with some *.cfg files where I define "globals" variables that will be sourced by others scripts and that I would like to be indexed for completion, and some *.awk scripts that I want to exclude by indexing since I don't need awk functions outside their script. In this example, my project looks like: { "name": "Bash Project" , "files": [{"directory": ".", "filters": ["*.sh", "*.profile", "*.func", "*.awk", "*.cfg"], "recursive": 1}] , "ctags_options": [ "--langdef=Cfg" , "--langmap=Cfg:.cfg\(*.profile\)" , "--regex-Cfg=/^[[:space:]]*((declare|local)[[:space:]]+(-[a-z]+[[:space:]]+))?([[:alpha:]][[:alnum:]]+(\\[[[:alnum:]]+])?)=/\\4/v,variables/" , "--exclude=*.awk" ] } Reproducible: Always
Created attachment 98433 [details] read "ctags_options" key from project configuration as string list Patch for version 15.12.3 This is the patch I use to get the example into description working. Anyway I think a better code may be wrote.
Hi Roberto, could you please submit your patch at http://git.reviewboard.kde.org? Also, I would like to change the json to: { "name": "Bash Project" , "files": [{"directory": ".", "filters": ["*.sh", "*.profile", "*.func", "*.awk", "*.cfg"], "recursive": 1}] , "ctags": { options": [ "--langdef=Cfg" , "--langmap=Cfg:.cfg\(*.profile\)" , "--regex-Cfg=/^[[:space:]]*((declare|local)[[:space:]]+(-[a-z]+[[:space:]]+))?([[:alpha:]][[:alnum:]]+(\\[[[:alnum:]]+])?)=/\\4/v,variables/" , "--exclude=*.awk" ] } } This allows us to easily extend the ctags section for future releases.
(In reply to Dominik Haumann from comment #2) > could you please submit your patch at http://git.reviewboard.kde.org? Patch changed to match your requirements and submitted to http://git.reviewboard.kde.org Review Request #127690 Hoping to have done it in the correct way. Regards, Roberto
Git commit 3bcd3d9c93d7af39ebce20f3dd275ad6dcac43fd by Dominik Haumann. Committed on 24/04/2016 at 10:12. Pushed by dhaumann into branch 'Applications/16.04'. Projects plugin: allow ctags options Thanks to Roberto Castagnola for the patch! REVIEW: 127690 M +26 -0 addons/project/kateproject.example M +7 -3 addons/project/kateprojectindex.cpp M +4 -2 addons/project/kateprojectindex.h M +2 -1 addons/project/kateprojectworker.cpp http://commits.kde.org/kate/3bcd3d9c93d7af39ebce20f3dd275ad6dcac43fd