Skip to content

Automatically insert import on code completion #21931

Closed

Description

@bwilkerson

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.

Activity

  1. alexander-doroshko commented on Aug 4, 2015

    @alexander-doroshko

    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).

  2. added
    P2A bug or feature request we're likely to work on
    type-enhancementA request for a change that isn't a bug
    and removed on Mar 1, 2016
  3. alexander-doroshko commented on Oct 10, 2016

    @alexander-doroshko

    sometimes contains names that are not yet imported

    Just curious in which cases non-imported names are suggested in completion and in which - not?

  4. danrubel commented on Oct 10, 2016

    @danrubel

    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.

  5. devoncarew commented on Sep 30, 2019

    @devoncarew
    Contributor

    This has been implemented now (see also #25820).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondevexp-completionIssues with the analysis server's code completion featurelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions