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

INSP: improve AttrWithoutParentheses: take into account `cfg_attr #6440

Merged
merged 4 commits into from Nov 27, 2020

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented Nov 26, 2020

An improvement for #6413: take into account attributes in #[cfg_attr(foobar, ...)]

c.c. @zeroeightysix

changelog: Detect attributes that require parentheses but have no parentheses, and suggest Add parentheses quick-fix for attributes under #[cfg_attr]

@vlad20012 vlad20012 added this to In Progress in To test via automation Nov 26, 2020
src/main/kotlin/org/rust/lang/core/psi/ext/RsMetaItem.kt Outdated Show resolved Hide resolved
src/main/kotlin/org/rust/lang/core/psi/ext/RsMetaItem.kt Outdated Show resolved Hide resolved
src/main/kotlin/org/rust/lang/core/RsPsiPattern.kt Outdated Show resolved Hide resolved
src/main/kotlin/org/rust/lang/core/RsPsiPattern.kt Outdated Show resolved Hide resolved
src/main/kotlin/org/rust/lang/core/RsPsiPattern.kt Outdated Show resolved Hide resolved
src/main/kotlin/org/rust/lang/core/RsPsiPattern.kt Outdated Show resolved Hide resolved
It returns `true` for top-level meta items like `#[foo]`, or for
 conditional attributes like `foo` `#[cfg_attr(windows, foo)]`
For now, this is just a test for `RsMetaItem.isRootMetaItem`, but
it could be used in `RsAttributeCompletionProvider`, for example
Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
bors r+

bors bot added a commit that referenced this pull request Nov 27, 2020
6440: INSP: improve `AttrWithoutParentheses`: take into account `cfg_attr r=Undin a=vlad20012

An improvement for #6413: take into account attributes in `#[cfg_attr(foobar, ...)]`

c.c. @zeroeightysix

changelog: Detect attributes that require parentheses but have no parentheses, and suggest Add parentheses quick-fix for attributes under #[cfg_attr]

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 27, 2020

Build failed:

  • check

@Undin
Copy link
Member

Undin commented Nov 27, 2020

bors retry

bors bot added a commit that referenced this pull request Nov 27, 2020
6440: INSP: improve `AttrWithoutParentheses`: take into account `cfg_attr r=Undin a=vlad20012

An improvement for #6413: take into account attributes in `#[cfg_attr(foobar, ...)]`

c.c. @zeroeightysix

changelog: Detect attributes that require parentheses but have no parentheses, and suggest Add parentheses quick-fix for attributes under #[cfg_attr]

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 27, 2020

Build failed:

  • check

@Undin
Copy link
Member

Undin commented Nov 27, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 27, 2020

Build succeeded:

@bors bors bot merged commit e7a96e3 into master Nov 27, 2020
To test automation moved this from In Progress to Test Nov 27, 2020
@bors bors bot deleted the toot-meta-item branch November 27, 2020 23:07
@github-actions github-actions bot added this to the v137 milestone Nov 27, 2020
@lancelote lancelote moved this from Test to Done in To test Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants