Local variables
Reports GDScript variables and constants that are declared but never used.
This inspection helps keep your scripts clean by detecting local variables and const declarations that have no usages in the project scope. If a type hint is present but refers to an unresolved type, the declaration is ignored to prevent false positives.
Examples:
Quick fix actions:
Remove the unused variable/constant.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
GdUnusedVariable- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
The inspection does not report declarations that are referenced anywhere in the project. It also skips declarations with unresolved type to avoid false alarms.
Inspection ID: GdUnusedVariable
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |