You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically insert import on code completion #21931
The code completion suggestion list sometimes contains names that are not yet imported into the current scope. When that happens, the import for the name should be automatically added when the suggestion is selected.
We have this functionality in IntelliJ IDEA already and we are loosing it as we are going to switch to DAS driven code completion. It is not always adding a new import, it may be updating show/hide of already existing import (if such suggestions are shown at all).
We no longer suggest any types that are not already imported. This is a result of my refactoring the code completion engine in Nov/Dec 2015 so that it consistently used resolved types throughout. I did not include non-imported types when I refactored the code because the implementation at that time was flawed and there is a blocking issue that must be tackled first.
Activity
alexander-doroshko commentedon Aug 4, 2015
We have this functionality in IntelliJ IDEA already and we are loosing it as we are going to switch to DAS driven code completion. It is not always adding a new import, it may be updating show/hide of already existing import (if such suggestions are shown at all).
alexander-doroshko commentedon Oct 10, 2016
Just curious in which cases non-imported names are suggested in completion and in which - not?
danrubel commentedon Oct 10, 2016
We no longer suggest any types that are not already imported. This is a result of my refactoring the code completion engine in Nov/Dec 2015 so that it consistently used resolved types throughout. I did not include non-imported types when I refactored the code because the implementation at that time was flawed and there is a blocking issue that must be tackled first.
See #25820 for more information.
devoncarew commentedon Sep 30, 2019
This has been implemented now (see also #25820).