Used variables appear as unused symbol

已回答

I am using IntelliJ Enterprise 2026.1.3. Recently, I have reinstalled my Mac, as well as IntelliJ. Since then, I notice that, my used variables are displayed as unused variables/symbols (grayed out), even though there is clearly indicator “xx usages”, as Screenshots.


I have looked under:

Settings > Editor > Inlay Hints > Code Vision > Java 

or 
Settings > Editor > Color Scheme > Java > Unused symbol

but nothing helped. Before reinstallation, the used variable appeared highlighted. 

Does anyone have any idea? Thanks

0

Hi Louis Tran ,  the screenshots mean the usage search behind Code Vision is right. Only the "unused symbol" highlighting color disagrees with it.

Please go to File | Invalidate Cache | enable 1,2, and 3 option | Invalidate and Restart.

If the issue persists, please help to reproduce this issue and capture logs via Help | Collect Logs and Diagnostic Data, upload the zip file to https://uploads.jetbrains.com/ and share the uploadID with us, thanks.

Meanwhile, please check if the issue still exists in 2026.2.x or not.

0

Hi Jerome Guan , thank you for your reply. I have tried this option before already. Here what I have observed: 

- When IntelliJ just restarted, these variables were highlighted (with the color of my theme), but the indicator “xxx usages” were still not displayed, because the project was still being imported (status at the bottom of IntelliJ). 

- As soon as the indicator “xxx usages" were displayed or project's importing was done, then these variables were grayed out again.

It seems there is some conflicted settings, but I can't figure out what it is.

0

Hi Louis Tran , thanks.

May I know if this issue happens with these three variables only?

Is it possible for you to share a reproducer project with us? If yes, please upload the project to https://uploads.jetbrains.com/ and share the uploadID with us, thanks.

Another option is to download a standalone 2026.2.2 build from https://www.jetbrains.com/idea/download/ and install it. Please do not import any settings, and open the same project then check if the issue persists or not.

The settings may be project-specific. Another option to try is the following:

  1. Back up and remove the .idea folder and .iml file in your project
  2. File | New | Project from existing sources to import the current project and rebuild index files.
0

请先登录再写评论。