Java imports code action breaks namespace form
armed opened this issue · comments
Describe the bug
In some cases import java package code action breaks :import
section of a ns form. I believe it happens when a new package's path matches to one which already imported. E.g. java.awt.event
and java.awt.<something>
.
To Reproduce
Steps to reproduce the behavior:
- assume following ns declaration:
(ns my.namespace
(:import [java.awt.event ActionEvent]))
;; ActionEvent is used somewhere in the code
- Add a new java class usage
Robot.
(def robot (Robot.))
- Execute code action which suggests to add
java.awt.Robot
to imports declaration - Form becomes broken:
(ns my.namespace
(:import [[java.awt Robot event] ActionEvent]))
Expected behavior
A form should look like this:
(ns my.namespace
(:import [java.awt.event ActionEvent]
[java.awt Robot]))