https://kotlinlang.org logo
#android-studio
Title
# android-studio
u

ursus

10/26/2023, 10:53 AM
when I use the fast find usage lookup, it gives me placed in generated code as well (moshi json adapter), can I omit that somehow? it's noise most of the time
e

efemoney

10/26/2023, 5:13 PM
Turn off generated files toggle?
u

ursus

10/26/2023, 5:13 PM
how
e

efemoney

10/26/2023, 5:14 PM
In the top bar of this “find” window that you just screen shotted halfway, its the one to the left of the
i
(which stands for imports)
If that toggle is already turned off, then its the case that the generated sources are erroneously registered as normal sources, in which case no out of the box solution. You will need to define a “scope” that excludes these files and use that instead. Search IJ custom files scope online …
u

ursus

10/26/2023, 5:24 PM
its turned on.. but why would it help
as you said i is for imports
oh to the left sry
e

efemoney

10/26/2023, 5:25 PM
Yeah it should be off so it doesnt show results from “generated sources”
u

ursus

10/26/2023, 5:26 PM
hm okay I turned it off and it still shows up however
e

efemoney

10/26/2023, 5:26 PM
Yeah then that means those files are not registered in IntelliJ as generated but as normal sources
u

ursus

10/26/2023, 5:26 PM
if I click into the search result, the file is under generated sources
so what makes them registered as generated
e

efemoney

10/26/2023, 5:27 PM
Yes the folder desnt matter its the tool/plugin that registers the folder with the IJ model, in this case Gradle/Kotlin IJ Plugin
u

ursus

10/26/2023, 5:27 PM
well its ksp + moshi .. okay so its ksp fault
e

efemoney

10/26/2023, 5:28 PM
Yup. if I remember correctly ksp (since it runs before kotlin) registers the files it generates as sources to the kotlin compile which make them appear in the IDE as normal sources. Not much you can do other than manually marking them as generated sources
u

ursus

10/26/2023, 5:28 PM
image.png
e

efemoney

10/26/2023, 5:29 PM
Yup exactly “sources root”
u

ursus

10/26/2023, 5:30 PM
anychane its moshi's fault? or should I go complain to ksp
hm, is it stil valid?
👌 1
seems like just the path should be enough
e

efemoney

10/26/2023, 5:31 PM
No not moshi’s fault. And not necessarily ksp’s too. But feel free to report to ksp. They will most likely point to Gradle but lets see
u

ursus

10/26/2023, 5:38 PM
will see, thanks!