madrapps / dagger-plugin Goto Github PK
View Code? Open in Web Editor NEWPlugin that supports easy usage of Dagger 2 library in IntelliJ iDEA or Android Studio
License: Apache License 2.0
Plugin that supports easy usage of Dagger 2 library in IntelliJ iDEA or Android Studio
License: Apache License 2.0
Visualize the Bindings as Tree in the Dagger Tool window. The graph should flow as below:
|> AppComponent // root component with one method that creates a CoffeeMaker
||||> CoffeeMaker // _the CoffeeMaker class with @Inject with params Heater/Pump _
||||>||||> Heater // the Provides method in the Module which produces the Heater
||||>||||> Pump // the Binds method in Module that binds a Thermosiphon
||||>||||>||||> Thermosiphon the Thermosiphon class with @Inject with param Heater
||||>||||>||||>||||> Heater the Provides method in the Module which produces the Heater
Component
should show the @component interface in the Editor.If a Method with type parameters is annotated with @Inject
, then highlight it as error with the message: "Methods with @Inject may not declare type parameters"
msg @Binds methods needs to be abstract
IntelliJ complains that the Dagger plugin won't work if I upgrade to IntelliJ 2021.2
Error Message: @provides methods may not have type parameters
Plugin freezes Android Studio completely while running task "Analysing dagger dependencies".
If disable/uninstall this plugin Android Studio working normally
Android Studio version 4.2.2
Error message: @provides methods may not use more than one @qualifier
In our app, we have several Dagger components, and our main one declares them as a dependency.
I only see the child components in the graph, but no the main one GlovoAppComponent
:
Log:
2020-08-13 12:11:57,682 [ 61100] INFO - STDOUT - Dagger Plugin : Processor - taskManager:com.intellij.tasks.impl.TaskManagerImpl@2d02a3a4
2020-08-13 12:11:57,687 [ 61105] INFO - STDOUT - Dagger Plugin : Processor - Start background task
2020-08-13 12:11:57,688 [ 61106] INFO - STDOUT - Dagger Plugin : Processor - Running background task
2020-08-13 12:11:57,866 [ 61284] INFO - STDOUT - Dagger Plugin : Processor - Compiling .[8].[230].
2020-08-13 12:11:58,421 [ 61839] INFO - STDOUT - Dagger Plugin : Processor - Compile success? true
2020-08-13 12:11:58,627 [ 62045] INFO - STDOUT - Dagger Plugin : Processor - Compiling .[1866].[623].
2020-08-13 12:12:03,065 [ 66483] INFO - STDOUT - Dagger Plugin : ------------------------------------------------------------
2020-08-13 12:12:03,066 [ 66484] INFO - STDOUT - Dagger Plugin : RootComponent - glovoapp.di.GlovoAppComponent
2020-08-13 12:12:03,066 [ 66484] INFO - STDOUT - Dagger Plugin : ComponentNodes - 159
2020-08-13 12:12:03,066 [ 66484] INFO - STDOUT - Dagger Plugin : ------------------------------------------------------------
2020-08-13 12:12:03,066 [ 66484] INFO - STDOUT -
2020-08-13 12:12:03,082 [ 66500] INFO - STDOUT - Dagger Plugin : Exception Handled
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - java.lang.RuntimeException: kotlin.KotlinNullPointerException
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.sun.tools.javac.main.Main.compile(Main.java:553)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.madrapps.dagger.core.Processor.compile(Processor.kt:111)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.madrapps.dagger.core.Processor.access$compile(Processor.kt:37)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.madrapps.dagger.core.Processor$process$task$1.run(Processor.kt:74)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:434)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:166)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at java.lang.Thread.run(Thread.java:748)
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - Caused by: kotlin.KotlinNullPointerException
2020-08-13 12:12:03,083 [ 66501] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.createNode(SpiPlugin.kt:140)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.access$createNode(SpiPlugin.kt:35)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin$addNodes$1.accept(SpiPlugin.kt:99)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin$addNodes$1.accept(SpiPlugin.kt:35)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at java.util.Optional.ifPresent(Optional.java:159)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.addNodes(SpiPlugin.kt:98)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.addNodes(SpiPlugin.kt:115)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.access$addNodes(SpiPlugin.kt:35)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin$addBindings$1.run(SpiPlugin.kt:63)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:869)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.addBindings(SpiPlugin.kt:56)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.madrapps.dagger.core.SpiPlugin.visitGraph(SpiPlugin.kt:50)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.validation.BindingGraphValidator.runPlugins(BindingGraphValidator.java:100)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.validation.BindingGraphValidator.visitPlugins(BindingGraphValidator.java:90)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.validation.BindingGraphValidator.isValid(BindingGraphValidator.java:64)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.isValid(ComponentProcessingStep.java:254)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.processRootComponent(ComponentProcessingStep.java:151)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:131)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:62)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.validation.TypeCheckingProcessingStep.lambda$process$0(TypeCheckingProcessingStep.java:51)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.google.common.collect.RegularImmutableMap.forEach(RegularImmutableMap.java:185)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.validation.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:48)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:124)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:62)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.internal.codegen.statistics.DaggerStatisticsCollectingProcessingStep.process(DaggerStatisticsCollectingProcessingStep.java:52)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:802)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
2020-08-13 12:12:03,084 [ 66502] INFO - STDERR - at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
2020-08-13 12:12:03,085 [ 66503] INFO - STDERR - at com.sun.tools.javac.main.Main.compile(Main.java:523)
2020-08-13 12:12:03,085 [ 66503] INFO - STDERR - ... 18 more
msg: @Binds methods' parameter type must be assignable to the return type
(For this case ensure MultiBinding use case, where the parameter won't be a child of parent, like Car and <Set>)
msg: @Binds methods must not return framework types
Error message: @provides methods must not return framework types
On my multi-module maven project:
on the dagger panel, always say Nothing to show.
after clicking Refresh button, showing Analysing dagger dependencies for a while, but no other outcome.
Android Studio: 4.2.2
Is this project still active/are there plans to revive it? There are open PRs and issues several months old.
Thanks for your effort, but it would be good to know if we should consider it as abandoned, in favour of other plugins or perhaps forking this.
Can this plugin be released for the new IDEA version?
Error message: @provides methods cannot be private
msg: @Binds methods must return a value (not void)
If the class is private and if a field or method is annotated with @Inject
then show the error with message: "Dagger does not support injection into private classes"
Title is self-explanatory
I have a maven project using dagger. I can see and use the dagger binding navigation in the margins of my code, but the Dagger window doesn't show any bindings.
I tried multiple things:
None of these worked.
Versions:
msg: @Binds methods must have exactly one parameter, whose type is assignable to the return type
msg: @BINDS methods may not have type parameters
The plugin is incompatible with the latest IDEA at the moment.
Thanks!
msg: @Binds methods cannot be private
IntelliJ freezes if I attempt to analyze dependency graph of my project.
I dunno if this is due to dependency cycles in my project being solved by using Lazy
or if something else goes wrong.
Steps to reproduce (Linux):
git clone https://github.com/plan-player-analytics/Plan.git
cd Plan
idea.sh Plan
Error message: @provides methods must return a value (not void)
Cannot install plugin in Android Studio Artic Fox
Error highlight with this message "@Inject constructors are invalid on inner classes. Did you mean to make the class static?"
inner class
As title, great work, thanks in advance!
Got the following error when I updated Intellij:
Plugin 'Dagger' (version '0.3.2020.3.3') is not compatible with the current version of the IDE, because it requires build 203.* or older but the current build is IU-211.6693.111
msg: @Binds methods cannot use more than one @Scope
If a method annotated with @Inject
throws a checked exception, show the error highlight with this message: "Methods with @Inject may not throw checked exceptions. Please wrap your exceptions in a RuntimeException instead."
Error message: @provides methods may only throw unchecked exceptions
msg: @Binds methods may not use more than one @Qualifier
I have the Dagger plugin installed in IntelliJ, for projects which use Dagger.
I have another project which uses Spring. In one of my files, which uses Spring injection, using the javax.inject.Inject
annotation, IntelliJ gives the following error on all private
fields which are annotated with @Inject
.
Dagger does not support injection into private fields
When Dagger is on in the classpath, then the Dagger plugin should not be active.
msg: @Binds methods may only throw unchecked exceptions
Error message: @provides methods cannot be abstract
IntelliJ Ultimate 2020.3.2
Kotlin 203-1.4.30-release-IJ7148.5
I get an error when dagger tries to analyze my code. Please let me know what other information I could provide!
java.lang.NoSuchMethodError: 'boolean org.jetbrains.kotlin.asJava.classes.UltraLightAnnotationsKt.isPrivateOrParameterInPrivateMethod(com.intellij.psi.PsiModifierListOwner)'
at com.madrapps.dagger.validation.ProblemKt.validatePrivateMethod(Problem.kt:27)
at com.madrapps.dagger.validation.ProvidesProblem.validateMethod(ProvidesProblem.kt:32)
at com.madrapps.dagger.validation.ProvidesProblem.isError(ProvidesProblem.kt:19)
at com.madrapps.dagger.validation.ValidationAnnotator.annotate(ValidationAnnotator.kt:25)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:136)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:116)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:336)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:269)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:295)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.lambda$analyze$1(HighlightVisitorImpl.java:211)
at com.intellij.codeInsight.daemon.impl.analysis.RefCountHolder.analyze(RefCountHolder.java:370)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.analyze(HighlightVisitorImpl.java:210)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:96)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:298)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:266)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:212)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Except Error
and RuntimeException
any other Throwable
should show the error highlight: "Dagger does not support checked exceptions on @Inject constructors"
Hi,
I am trying to use this plugin with a bazel project on intellij and nothing shows up. Just wondering if you had any plans to support bazel projects in intellij
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.