Disable intentions/Blockstatement question


I have a concept where I use BinaryOperation as a child. This has some intentions with it, but I don't want to have for instance the FlipBinaryOperation. Is there a way to disable specific intentions from a concept?


I have several statements I want to print in a java method.


Float setup = new Float(1)

Where I LOOP over both, and COPY_SRCL all setup and COPY_SRCL all methods (compareTo) from concepts I created. To LOOP I use a BlockStatement, but if I look at the output the method looks like this

public void test(){
   Float setup = new Float(1)

If I look at the example in this case the calculator example, it is used quite similiar, but without the braces in the code output.

  add(new JLabel("$Title"));

I solved it in another way, with a Template Switch, where I have for the

"Float setup = new Float(1)" part a template fragment and also for the
"setup.compareTo(1)" part a template fragment and I then Loop over the switch. It works this way, but I would prefer the block statement method, but it doesn't work.

Thanks in advance for any help.

About your Q1, the easiest way I know to disable an intention is through: File->Settings->Intentions.

There you have a list of intentions per language and you can disable the ones you want.

OK, I thought about the thing that is disallowed for everyone, not just only in my editor. Like with constrains, child y from parent x where child y's intention is disallowed, but only with parent x. Don't know if this is even possible..
Q1: I do not know of a way to disable intentions on sub-concepts, unless the original intentions provide such a capability, perhaps through a behaviour method.

Q2: BlockStatement's TextGen flattens BlockStatements, which are nested inside StatementLists and which do not contain variable declarations. (Granted, the detection could be made more sophisticated)
Your BlockStatements contain variable declarations, thus will not be flattened automatically.

Please sign in to leave a comment.