ForceFeedbackProgramming icon indicating copy to clipboard operation
ForceFeedbackProgramming copied to clipboard

Exclude functions from feedback

Open ralfw opened this issue 9 years ago • 5 comments

Exclude single methods from feedback eg. by adding an attribute on top of them:

[ForceFeedbackProgramming(Check=false)]
public void Do_sth(...) {
  //...
}

Such exclusions could be useful during a refactoring, to work without being hampered. Or really dirty methods could be excluded.

ralfw avatar Jun 17 '16 15:06 ralfw

Attributes are for adding semantics to code elements, not for controlling the IDE at all. Better would be to use compiler directives for this requirement (e.g. as is for disable warnings). Maybe we are able to extend and use them like this:

#pragma warning disable 649
...
#pragma warning restore 649

robinsedlaczek avatar Jul 04 '16 15:07 robinsedlaczek

That's right: attributes are runtime annotations. But if you can access pragmas on the AST we could use them. Can we use symbolic names, e.g. #pragma warning disable forcefeedbackprog?

ralfw avatar Jul 04 '16 16:07 ralfw

Sounds good. But the compiler does not recognize exactly this pragma. I tried this because I wanted to suggest this solution. So we have to figure out how to extend pragmas.

robinsedlaczek avatar Jul 04 '16 17:07 robinsedlaczek

And yes, we can see pragmas in the AST. That are syntactical irrelevant elements - so called trivias! :-)

robinsedlaczek avatar Jul 04 '16 17:07 robinsedlaczek

Well, they are relevant to us ;-) So if we can see them, we can interpret them. However, it seems we can only use warning numbers for our purposes :-(

Or how about comments? The //TODO comment is interpreted by the IDE. Why not a a //forcefeedbackprog=off comment?

ralfw avatar Jul 04 '16 17:07 ralfw