Bug 377026 - KDevelop should provide a menu for placing to the cursor some C++ features.
Summary: KDevelop should provide a menu for placing to the cursor some C++ features.
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-02-28 15:33 UTC by Petros
Modified: 2018-10-28 03:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petros 2017-02-28 15:33:34 UTC
I am explaining myself: When a programmer writes C++, it would be nice if certain menus and/or shortcuts enabled the programmer to place a skeleton for certain C++ features.

Eg you use an STL algorithm and you press a shortcut and a lambda skeleton is created.

Another: You create in place a class skeleton.

You could also create a functor skeleton with the help of an interactive dialog that would take the class's name and the privates and publics variables as parameters.
Comment 1 Sven Brauch 2017-02-28 16:47:15 UTC
I'm not sure I understand this wish correctly. We have the snippets plugin from kate which does pretty much exactly that interactively in the editor, and we have the template stuff which does pretty much exactly that but with dialogs. What workflow do you miss? There is certainly no place for yet another workflow between those two IMO.

Maybe you just haven't used the snippets plugin yet? ;)

Greetings,
Sven
Comment 2 Petros 2017-02-28 18:41:05 UTC
(In reply to Sven Brauch from comment #1)

> Maybe you just haven't used the snippets plugin yet? ;)

First, I think you did unsterstand correctly. Indeed I can create a snippset for lambda, which can be triggered when Cnt+Space shows autocomplete and snippsets.

But for a class, a functor or even a (C++) Template skeleton, I don't always wish to create new files with a (kdevelop) template, but rather write a simple, small class, or Template in place, in the file I am currently working. 

So, would you consider usefull a feature that does exactly the same thing without creating new files but placing inside an existing one?

PS. Thank you for the clarification though.
Comment 3 Petros 2017-02-28 18:41:38 UTC
And yes I did miss the snippset plugin.
Comment 4 Sven Brauch 2017-02-28 18:56:07 UTC
> But for a class, a functor or even a (C++) Template skeleton, I don't always 
> wish to create new files with a (kdevelop) template, but rather write a simple, 
> small class, or Template in place, in the file I am currently working. 

But that is what the snippets plugin does, no?
Comment 5 Petros 2017-02-28 19:13:40 UTC
(In reply to Sven Brauch from comment #4)
> But that is what the snippets plugin does, no?

As far as I know I can't interactively give properties (eg name for the class, the functor or even if a default (de)constructor should appear in it). I hope you get the idea of full customisability that I am talking here. Sure, I as a developer will write the code; not a kdevelop template will. But it would be nice to just give the name of the class in a dialog, click if a default constructor is to be shown and voila. I can have a customized skeleton where I want it and start doing exactly this; write just the code.

This might not be restricted to classes only; it's just that I can't imagine another c++ feature that can be created like this.

Ok I have to admit that for c++ templates, a snippset with a small skeleton might cut it. Nothing here to interactively ask the user and append to the template.
Comment 6 Sven Brauch 2017-02-28 23:46:00 UTC
Templates are fully scriptable and you can have editable fields for e.g. the class name. You can also generate code depending on the content of editable template fields. It's not a dialog, but it's pretty close I think ... for example the "give classname, have fitting constructor / destructor created" is trivial with it, just write something like

class ${class} {
  ${class}();
  virtual ~${class}();
};
Comment 7 Sven Brauch 2017-02-28 23:47:03 UTC
Sorry, that is the snippets plugin I was talking about. It's called "template engine" internally, so I got confused ;)
Comment 8 Petros 2017-03-01 12:21:54 UTC
No worries ;)

Anyway, these are just some ideas. They may lead to other ideas or they may not. Either way KDevelop is pretty competitive and I have trust in the developers that if they find something nice, they will implement it.

Besides it's not bad afterall if a feature or idea is taken from another IDE. Have a nice day :)
Comment 9 Andrew Crouthamel 2018-09-28 02:44:54 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Andrew Crouthamel 2018-10-28 03:31:59 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!