Skip to content

Import declaration not added when requesting a constructor completion for a class in a different package #362

@mauromol

Description

@mauromol

Consider the Groovy class:

package test4
class MyBean {
   String foo
}

and the following:

package test5
class MyBean {
  int bar
}

(please note: two classes with the same name in different packages)
Then the following:

package test5
class TestCompletion {
	void doSomething() {
		new MyB|
	}
}

(please note: same package as the second MyBean class).
Invoke code assist at "|" and choose test4.MyBean(): the constructor invocation is completed, but no import statement is added, hence the class being constructed is indeed test5.MyBean instead of test4.MyBean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions