"Create Snippet From Selection" context-menu entry

David Nolden zwabel at googlemail.com
Fri Feb 12 00:58:28 UTC 2010

Am Freitag 12 Februar 2010 01:41:22 schrieb Milian Wolff:
> On Thursday 11 February 2010 23:46:23 David Nolden wrote:
> > Hi! I have a problem with this context-menu entry in the editor. The
> > problem is that it shows up _always_, and it shows up in a very bad
> > place, without any separation from the code-navigation features.
> If you tell me how I could separate it from the code-navigation entries,
>  I'll happily do so. And regarding the "shows up always": I can change it
I cannot tell you right now, but you need to put it into the correct category.

>  to only show once a selection is actually available, but that imo
>  decreases the discoverability of that feature immensely. What do others
>  think?
Well but it's totally normal for a "context" menu to only show entries that 
are _valid_ in that context, so this action should do the same. Greyed-out 
entries by definition don't belong into a context-menu.
> > Yes in same cases it's greyed out, but anyway I think this anyway is not
> > something you will be doing all the time. Such "random plugin" entries
> > should only show up if there is a real indication that the user is
> > actually using that plugin, for example it should definitely not show up
> > if I don't even have the snippet tool view added to my mainwindow.
> Well, the question here is: Is a plugin supposed to be "working" or
> "activated" without it's view? In the snippets case it is not imo - just
>  like you say, but what about other plugins? And this also imposes a bit of
>  additional cruft on my side (i.e. track how many views are available and
>  only show if the number of views is higher than 0.
> But actually snippets are "working" without a snippets view. You just can't
> edit them.
> Why don't you simply deactivate the snippets plugin if you don't want to
>  use it?
We're trying to create an out-of-the-box well-working IDE here, so 
configuration-changes are only the very last option.

> > IMO the right place for this probably infrequently used action thing be
> > the main-menu (maybe Editor -> Snippets or something like that).
> You may use it infrequently, I happen to use it quite often to create new
> snippets. It's much faster than writing it in the snippet dialog. And I
>  fear we all could argue about what is infrequently used and what not ;-)

Well I guess writing, navigating, refactoring etc. is much more frequent in an 
IDE than creating custom snippets, even if you actually use snippets. And the 
infrequent actions shouldn't stand in the way of the important ones.

Anyway I guess we can easily solve this whole problem by making it just a bit 
more context-sensitive: Simply only show that action when there actually is a 

Greetings, David

More information about the KDevelop-devel mailing list