finger563/webgme-codeeditor

Add code editor button to copy into the active code object from a template

Closed this issue · 4 comments

AWatk commented

Use a button similar to the info button to allow the user to fill in a code object from a set of seeds/examples or from pre-existing code objects of the same type within the project. Allows the specification of (but not the constraint to 😢) a style/convention for each code object.

Example:

The user fills in an empty subscriber from a basic_subscriber seed to act as a guide for a subscriber.

//check msg_data's type!
int msg_data = received_data->data;

//do stuff

//publish another message
package_name::message_name msg;
msg.data = local_data;
message_publisher.publish(msg);
AWatk commented

on the other hand, simply having an example code snippet in the documentation for each code object via the info button works for the example shown above. But it would still be useful for copying from other user written code within the project.

This can also be solved by having the default attribute (i.e. the attribute value in the meta) be the template you want. Copying from another object (which may not even be loaded by the code editor) within the project is a requirement that's pretty hard to specify properly from just the component configuration of the editor unfortunately.

Is this still something that should be added to CodeEditor, or is this issue closed?

AWatk commented

I'd say leave this open until we finish the next round of upgrades and re-evaluate our capabilities. If it still seems infeasible or is better solved another way, it can be closed then.