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

Stop IntelliJ suggesting commonly shaded packages #1350

Merged
merged 4 commits into from
May 20, 2020

Conversation

CRogers
Copy link
Contributor

@CRogers CRogers commented May 20, 2020

Before this PR

Jars commonly contain shaded dependencies - you should never use them, but they end up polluting your autocomplete suggestions:

Screen Shot 2020-05-20 at 5 13 36 PM

Internally, someone was confused why their code wasn't compiling because they were using a shaded version of an interface that was generated by gradle-shadow-jar.

After this PR

==COMMIT_MSG==
Classes in common shaded packages are no longer for autocompletion/auto-import recommended by IntelliJ.
==COMMIT_MSG==

Screen Shot 2020-05-20 at 5 27 48 PM

Screen Shot 2020-05-20 at 5 28 39 PM

Possible downsides?

I can't really think of any. It's only "bad" if people want to use this shaded classes (they shouldn't) and would perhaps be annoying they're not suggested? Even then, this just stops suggestions, you can still find them/use them:

Screen Shot 2020-05-20 at 5 30 30 PM

@changelog-app
Copy link

changelog-app bot commented May 20, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Classes in common shaded packages are no longer for autocompletion/auto-import recommended by IntelliJ.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco May 20, 2020 16:31
<name>org.gradle.internal.impldep</name>
<name>autovalue.shaded</name>
<name>org.inferred.freebuilder.shaded</name>
</excluded-names>
Copy link
Contributor

Choose a reason for hiding this comment

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

@ilyanep If memory serves you had a list of packages that are helpful to exclude, is there anything missing here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@carterkozak My full list is:

  1. com.palantir.shaded
  2. com.sun.javafx.collections
  3. com.sun.tools.javac.util
  4. com.sun.xml.internal
  5. de.intarsys
  6. io.vavr
  7. jersey.repackaged
  8. org.apache.poi.ss.formula
  9. org.aspectj.lang.annotation
  10. org.codehaus.jackson
  11. org.jooq.Exception.IOException
  12. shaded.com.palantir
  13. shaded.es244
  14. shaded.es6x

Copied from what I have configured right now, though not sure how many of those are generally applicable for baseline. Hope that's helpful!

@ferozco
Copy link
Contributor

ferozco commented May 20, 2020

Nice this is very slick! I really appreciate it for gradle plugin development

…alantir/gradle-baseline into callumr/stop-suggesting-shaded-classes
@ferozco
Copy link
Contributor

ferozco commented May 20, 2020

👍 @CRogers did you test this out locally to make sure the plumbing is all set?

@bulldozer-bot bulldozer-bot bot merged commit bedaac9 into develop May 20, 2020
@bulldozer-bot bulldozer-bot bot deleted the callumr/stop-suggesting-shaded-classes branch May 20, 2020 16:46
@svc-autorelease
Copy link
Collaborator

Released 3.14.1

@ferozco
Copy link
Contributor

ferozco commented May 20, 2020

wrecked, I approved at the same time you added the labels :(

@CRogers
Copy link
Contributor Author

CRogers commented May 20, 2020

Race conditions!

Yep, I tested locally on a couple of projects (this "after" screenshot was from one of them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants