Removing 'my' when generating getters and setters

已回答

When I produce a getter for a field 'myExample', it is now called 'getMyExample'. Instead I would like 'getExample' to be produced. I know that I have changed this in the past, but I can no longer find the option to do this and unfortuantly have failed to find a post with the same issue. Is there a setting somewhere to remove the 'My' part for setters and gettters?

0

I found in Settings -> Editor -> Code Style -> C/C++ -> Naming Convention:
If you add a prefix of 'my' to the Member Field 'Entity Kind', then getters and setters will behave as expected.

0

Hi,

Starting from CLion 2019.1 there is `Naming Convention` Tab in *Settings -> Editor -> Code Style -> C/C++* as Daniel mentioned. In earlier version please check `Code Generation` tab.

But in both case you can update only prefix for getter. So the  Getter name is constructed by `prefix` + `field_name`. Your field name is `myExample`

0

请先登录再写评论。