Skip to content
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

Reduce availability range of some intentions #6923

Merged
merged 1 commit into from Mar 9, 2021
Merged

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented Mar 5, 2021

Reduce availability range of some intentions:

  • AddElseIntention now is not available inside if body
  • InvertIfIntention is now available only in if keyword
  • IfLetToMatchIntention is now available only in if let keywords and = token
  • MatchToIfLetIntention is now available only in match keyword
  • SplitIfIntention is now available only in a binary operator (like &&)
  • FlipBinaryExpressionIntention is now available only in a binary operator (like &&)
  • ExtractInlineModuleIntention is now available only in mod keyword, a module name and its visibility (not available in a module body or its attributes)
  • RsShowMacroExpansionIntentionBase is now available only in a macro call path and ! token

This mostly follows availability ranges of Kotlin's intentions

changelog: Reduce availability range of some intention actions. For example, now "Add else branch to this if statement" should not be suggested in Alt + Enter menu when the caret is placed inside an if body

- `AddElseIntention` now is not available inside `if` body
- `InvertIfIntention` is now available only in `if` keyword
- `IfLetToMatchIntention` is now available only in `if let` keywords and `=` token
- `MatchToIfLetIntention` is now available only in `match` keyword
- `SplitIfIntention` is now available only in a binary operator (like `&&`)
- `FlipBinaryExpressionIntention` is now available only in a binary operator (like `&&`)
- `ExtractInlineModuleIntention` is now available only in `mod` keyword, a module name and its visibility (not available in a module body or its attributes)
- `RsShowMacroExpansionIntentionBase` is now available only in a macro call path and `!` token
@vlad20012 vlad20012 added the fix Pull requests that fix some bug(s) label Mar 5, 2021
@vlad20012 vlad20012 added this to In Progress in To test via automation Mar 9, 2021
@vlad20012
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 9, 2021

Build succeeded:

@bors bors bot merged commit c5379d9 into master Mar 9, 2021
To test automation moved this from In Progress to Test Mar 9, 2021
@bors bors bot deleted the intentions-scope branch March 9, 2021 19:31
@github-actions github-actions bot added this to the v144 milestone Mar 9, 2021
@lancelote lancelote moved this from Test to Done in To test Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant