Open TechPriest-alpha opened 6 years ago
Check this.
Thanks for the suggestion, but unfortunately it didn't help. Original problem remains: IDEA still displays same highlights for plugin installed from disk. 'Invalidate caches & Restart' after plugin re-install didn't help either.
Just to clarify: there are neither compilation problems, nor any errors when working with vals in code. Just false-positive warnings from IDE about missing finals.
I experience the same problem. Unfortunately, this also leads to other problems when using lombok's val
in combination with other plugins like "SaveActions" that seem to rely on the suggestions offered by IntelliJ. Since the 2018.1 update, SaveActions automatically applies the final
keyword before val
which was definitely not the case before.
Surprisingly this seems to be a problem in Intellij's inspection which ignores how this plugin "fakes" the final keyword:
That's indeed surprising! Thank you @kossmoboleat :) As suggested in referenced IDEA issue: disabling "Report variables which are implicit final" under "Local variable or parameter can be final" seems to solve problem.
I'd leave this ticket open for awhile just in case there is possible workaround on lombok plugin side (comment from plugin maintainers will be really appreciated). If there is no way to update plugin's behavior to work with new IDEA API, then it would OK to close this issue I think.
Yes, the workaround seems to work for the inspection, but it doesn't for usage in combination with the "save actions" plugin, because that one doesn't seem to respect the checkmark.
Also by using this workaround, we're then not getting the correct the correct inspection result for that try-with-resources case mentioned in the youtrack issue. I wrote there again, but I'm also not that knowledgeable if the check I proposed there is the way to go.
@mplushnikov What do you think is the best course of action here? Should we ask the Jetbrains developer to add a new API for this?
It seems to me that one would a new access to the final modifier because the implicit modifier is either ignored in the default setting or it isn't and the linked resource case isn't properly handled.
@mplushnikov Any new thoughts on this?
@kossmoboleat Nothing special at the moment, just only asked @akozlova about new extension point...
@mplushnikov Ok, the Intellij developer requires some feedback before she continues: https://youtrack.jetbrains.com/issue/IDEA-182740
@mplushnikov, can you please answer @akozlova on youtrack?
@kossmoboleat I'm very sorry, answered the question only now. There is a lot of work family man:(
Short description
After upgrade to IntelliJ 2018.1 and latest Lombok Plugin available from plugin repository I'm getting IDE highlights on variables marked with 'val', that they don't have 'final' modifier (IDEA inspection 'Local variable or parameter can be final').
Expected behavior
No variable highlighting and IDE correctly reads 'val' as having 'final' modifier.
Version information
Steps to reproduce
Sample project
Please provide a sample project that exhibits the problem. You should also include
.idea
folder so we can inspect the settings.