You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you select an expression, e.g. inside an if statement, and extract that as a function you get a void function. Either c-xref should recognize the text as in the context of an expression, or give you an option to extracting it as a non-void function with a return statement.
The latter is probably the only choice for C since everything is an expression and you can have expressions everywhere. It seems that in Java the distinction is made since there are both Extract Method and Extract Function, but only the latter is available for C.
The text was updated successfully, but these errors were encountered:
This could possibly be accomplished by combining 'extract variable' on the expression, then applying 'extract' function to the new variable initialization.
I agree that being able to extract expressions in general would be a useful enhancement.
If you select an expression, e.g. inside an
if
statement, and extract that as a function you get avoid
function. Eitherc-xref
should recognize the text as in the context of an expression, or give you an option to extracting it as a non-void function with a return statement.The latter is probably the only choice for C since everything is an expression and you can have expressions everywhere. It seems that in Java the distinction is made since there are both Extract Method and Extract Function, but only the latter is available for C.
The text was updated successfully, but these errors were encountered: