Bug 506468 - [codegen] #define to refer to protocolmessage parameters should be shorter
Summary: [codegen] #define to refer to protocolmessage parameters should be shorter
Status: CLOSED FIXED
Alias: None
Product: Papyrus-rt
Classification: Modeling
Component: codegen (show other bugs)
Version: 0.8.0   Edit
Hardware: PC Mac OS X
: P3 normal
Target Milestone: 0.9.0   Edit
Assignee: Ernesto Posse CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2016-10-24 17:04 EDT by Charles Rivet CLA
Modified: 2016-12-15 09:55 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Rivet CLA 2016-10-24 17:04:29 EDT
As it currently stands, the #defines generated by the code generator all have the "umlrtparam_" prefix.

This is problematic in two ways:
  1) It does not match the parameter names as listed in the model.
  2) It means more characters to type when the values have to be accessed.

Both affect tool usability.

One solution would be for the #defined strings to match the name used in the protocol message definition.
Comment 1 Peter Cigehn CLA 2016-10-25 03:23:50 EDT
I made a similar comment in a discussion in this area quite some time ago. It was a discussion also related to the code snippet view and the integration with the completion support, i.e. the fact that the parameter is actually a #define and whether CDT would be able to perform completion support with "locally scoped" #define's. There is no such thing as a locally scoped #define, and this this has to be solved with repeatedly doing #undefine also. Are CDT able to handle this?

I would like this also be considered in the solution of this Bugzilla, i.e. how any future completion support/content assist in the integration with CDT will behave when you want to have completion support for completing a parameter.

In fact, having a prefix (but maybe a shorter one) could be beneficial from a completion support perspective, i.e. start typing the "parameter prefix" and then bring up content assist which then only will list the parameters of the current protocol message. 

But since the aspect of typing the parameter name manually, a shorter prefix (or possibly none at all as Charles proposes) is beneficial from that perspective.
Comment 2 Eclipse Genie CLA 2016-11-14 15:52:45 EST
New Gerrit change created: https://git.eclipse.org/r/85000
Comment 3 Eclipse Genie CLA 2016-11-14 15:52:45 EST
New Gerrit change created: https://git.eclipse.org/r/85000
Comment 6 Ernesto Posse CLA 2016-11-14 16:41:25 EST
I removed the prefix entirely so that you type the protocol message's parameter(s) name only. The code generator already creates #undef directives for each of these.

I'll mark it as resolved, but I leave it to you to close or decide if you want an explicit (but shorter) prefix.
Comment 7 Charles Rivet CLA 2016-12-15 09:48:43 EST
That's fine.
Comment 8 Charles Rivet CLA 2016-12-15 09:48:56 EST
Closing as fixed.
Comment 9 Charles Rivet CLA 2016-12-15 09:54:52 EST
Moving to future after discussion with Ernesto and Simon.
Good thing to have, but does not affect the code generation for 1.0.
Comment 10 Charles Rivet CLA 2016-12-15 09:55:43 EST
Modified wrong bug (too many windows...) reverting to 0.9...