In my Kotlin files IntelliJ no longer highlights u...
# intellij
v
In my Kotlin files IntelliJ no longer highlights unused constructor, however, it still does that for my colleague. So did I turn that off maybe?
image.png
there is no inspection for Kotlin for “unused declaration”
in Java it works fine:
actually, it doesn’t even highlight local variables that are unused 🤔
I’m on K2 compiler, is that why?
c
It should work with K2
a
Unused symbol was implemented for K2 in 2024.2. Could you please specify your IJ version? Thanks
v
Copy code
IntelliJ IDEA 2024.3.4.1 (Ultimate Edition)
Build #IU-243.25659.59, built on March 4, 2025
Subscription is active until October 6, 2025.
Runtime version: 21.0.6+8-b631.39 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 14.4.1
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 12288M
Cores: 10
Metal Rendering is ON
Registry:
  debugger.watches.in.variables=false
  ide.allow.merge.buttons=false
  ide.experimental.ui=true
  terminal.new.ui=true
  ide.images.show.chessboard=true
Non-Bundled Plugins:
  org.intellij.plugins.hcl <tel:(243.25659.42|(243.25659.42>)
  PythonCore <tel:(243.24978.46|(243.24978.46>)
  com.intellij.properties.bundle.editor (243.21565.122)
  com.github.camork.fileExpander (2.5)
  Pythonid <tel:(243.25659.59|(243.25659.59>)
  PlantUML integration (7.11.2-IJ2023.2)
  ru.adelf.idea.dotenv (2024.3)
  JProfiler (20.0)
  com.intellij.lang.jsgraphql <tel:(243.25659.42|(243.25659.42>)
  com.github.copilot (1.5.38-243)
Kotlin: <tel:243.25659.59|243.25659.59>-IJ
a
Should work actually, very strange that there are even no settings! Could you please attach idea.log? (Help | Show log)
v
so is there supposed to be an inspection in Kotlin inspections? called “Unused symbol”?
a
yes,
Kotlin | Redundant constructs | Unused symbol
v
image.png
so strange, there is no way to delete inspections so how could it be missing 🤔
c
ah, there are about 50 items in that menu for me
v
maybe i should try to do clean install, and before i import my settings check what it shows.. maybe the cruft of settings/plugins over the years broke something
a
idea.log would definitely help to check that out
v
dm’d you the logs, thanks
👀 1
a
KTIJ-33492 it is caused by disabled gradle plugin. I am sorry for the inconvenience
v
oh great find, thank you so much I enabled the
Gradle
plugin and then did “Just restart”, now it all works!
I personally find Gradle to be one of the worst build tools out there and am a bit sad Kotlin decided to embrace it so much. We are very happy with Maven and hope it continues to be supported. Of course, having the plugin enabled is no big deal for me. I tend to disable plugins I don’t use but it’s fine.