Bug or feature ? Edited project-generated targets are saved

Alexander Neundorf neundorf at kde.org
Thu Feb 8 21:39:35 GMT 2024


Hi,

On Mittwoch, 7. Februar 2024 23:02:36 CET Alexander Neundorf wrote:
> Hi,
> 
> the project plugin can generated targets for the build plugin.
> The entries in the build plugin are editable by the user.
> This may be useful, e.g. to change the "-j8" flag for make, or maybe add
> some other option.
> 
> But, such a change is also saved. And from that moment on, it seems kate
> always loads the saved, edited targets, no matter whether the project
> plugins generates different targets now (e.g. because the cmake files for
> that project have been changed).
> 
> To me this feels like a bug.
> I think it may be useful that the build commands are editable, it provides
> some flexibility. If they were not editable at all, this would be also Ok
> for me.
> But that my edits are saved and then override the "new" targets from the
> project plugin feels like a bug, the targets are then not up to date anymore
> with the current state of the actual project.

Ok, I found it, it's a feature:
https://invent.kde.org/utilities/kate/-/commit/
678e8a3bd98d5110da21091aefef00aa9cf3097f[1]

TBH, this feels like a bug.
I add a new target in cmake, and it doesn't appear in the build plugin.
I remove a target, it's still there.
There is no indication that this was read from a file, and that the input from the project 
plugin is ignored now.

I understand the motivation: the user changes something, so this should be kept.
Nevertheless, how about removing this questionable feature ?
This would make the code a bit simpler.

Or, keep it, but instead of storing the full override, just store what has been changed ? E.g. 
"target foo moved 2 rows up" or "command target for target bar edited" etc. and then 
apply those modifcation to what comes from the project plugin. Sounds like it would result 
in relatively complicated code.

Or, maybe store a hash of the targets as they come from the project plugin, store the hash 
together with the override, and only use the override if the targets from the project plugin 
still have the same hash ?

Something else ?

Alex


--------
[1] https://invent.kde.org/utilities/kate/-/commit/
678e8a3bd98d5110da21091aefef00aa9cf3097f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20240208/49b10141/attachment.htm>


More information about the KWrite-Devel mailing list