--Eclipse's code completion feature ** unintentionally completes when completing a method name for a class! It is a measure when you think ** (Suppressing side effects of ** Substring code completion function added in Eclipse NEON Is the one)
If you hit a dot (**. **) with ** Arrays **, code completion will be completed. Then, if you enter ** tostring ** and press enter, ** deepToString ** will be selected.
Even if you enter only ** string ** as shown below, it will give you candidates that include ** string ** as part of the method name.
Partial matching of method names is bad, so try turning this feature off the settings.
If you select ** Window> Preference> Java> Editor> Content Assist ** from the main window of Eclipse, the item ** Show substring matches ** -store.s3.ap-northeast-1.amazonaws.com/0/170905/ec003ceb-52de-271a-9cbd-83873e730029.png), so turn it off ** //qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/170905/9a19cb9f-b238-e47a-79b4-e62be45a958b.png)
It feels pretty good. ** deepToString ** is no longer unintentionally selected as before.
As a trial, when I typed ** string ** after ** Arrays. **, no candidates came up.
First, open the setting screen with ** Window> Preference> Java> Editor> Content Assist ** as before .amazonaws.com/0/170905/df96a4ec-3fbb-3a5d-4e11-47f5a1e2722a.png) is checked.
This will enable partial matching for the time being.
Next, expand the settings through the [+] mark of ** Content Assist ** and select ** Advanced **.
Next, check ** Java Proposals ** as shown below.
This is OK
Now, try code completion again with this setting.
It seems that it is moving with the intended movement
Partial match is also working properly.
Correction method 2 seems to be the more intended behavior (with partial matching, code completion is also as intended).
--I explained the phenomenon and countermeasures when I thought that "it will be unintended completion" in Eclipse code completion. --The substring code completion function is a function added in Eclipse NEON, but if the side effect results in unintended completion, you can turn off ** substring code completion ** or ** It turns out that side effects can be suppressed by taking measures to enable Java Proposals **. --For code completion, ** Intellij IDEA ** (and Android Studio) is much ahead of the game and supports ** substring code completion **, and seems to have been tuned in advance to avoid these side effects. (I didn't notice it until I encountered it in Eclipse, but the slight differences created by tuning the UI and usability like this affect productivity and quality.)
Recommended Posts