-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features/#148 multiline function call in a single-line declared section #392
Features/#148 multiline function call in a single-line declared section #392
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not everything works as expected
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Show resolved
Hide resolved
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Show resolved
Hide resolved
refactored: inspection code, SmkRuleOrCheckpointArgsSection got new function We create separate method in SmkRuleOrCheckpointArgsSectionImpl in order not to duplicate code, if there any other SmkRuleOrCheckpointArgsSection inheritor, which will need the same logic e.g. 'use' section. Other variant is to move multilineSectionDefinition() implementation into SmkRuleOrCheckpointArgsSection interface but I'm not sure if it is a good idea to mix definition and implementation. Resolves: #148
fixed: quickfix was modified, so now it suggests to transform single-line declared section to multiline declared as follows:
refactored: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get rid of harcoded TAB meaning. In general everything works good.
src/main/kotlin/com/jetbrains/snakecharm/lang/psi/impl/SmkRuleOrCheckpointArgsSectionImpl.kt
Outdated
Show resolved
Hide resolved
import com.jetbrains.snakecharm.SnakemakeBundle | ||
import com.jetbrains.snakecharm.lang.psi.SmkRuleOrCheckpointArgsSection | ||
|
||
const val TAB = " " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use such TAB def here, number of spaces in TAB is IDE setting. More over user could use real TAB character instead of spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/kotlin/com/jetbrains/snakecharm/inspections/SmkMultilineFunctionCallInspection.kt
Outdated
Show resolved
Hide resolved
fixed: TAB hardcoding, 'contains' function calling |
…x method, let's cache it value in local variable
Issue #148 is resolved