testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Add Eclipse Favorites - for static import of org.testng.Assert.* #154

Closed verhagen closed 7 years ago

verhagen commented 9 years ago

It would be nice to have the Assert static imports available under Content Assist Favorites. Added by the TestNG plug-in. If the Assert static imports are available in that way, importing a static method is easier, as they appear on top of the suggestion list.

Like when coding

@Test
public void someTest() throws Exception {
    assertEq<press suggestion keys>
}

I've no idea if it is possible to create an Favorites entry, by another plug-in.

The action plan below, shows how it is done manually.

Action Plan

missedone commented 9 years ago

@verhagen As there is no official plugin extension point for adding new "favorite static import", though I know there's way to hack that (such as programmatically add testng static import into the PREF_CODEASSIST_FAVORITE_STATIC_MEMBERS preference store), however i don't like the hack that it just make the code unnecessary complex.

so the short answer is, no, i don't think we can support this at the moment, please manually add it. thanks

missedone commented 7 years ago

@verhagen, the feature is available in latest beta now: http://beust.com/eclipse-beta thanks

missedone commented 7 years ago

now the static import org.testng.Assert.* will be added when Eclipse startup, if people manually remove it from the preference, it won't be added again.