Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
verhagen opened this issue Jun 12, 2015 · 3 comments
Closed

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

verhagen opened this issue Jun 12, 2015 · 3 comments

Comments

@verhagen
Copy link

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

  • Use Eclipse menu: Windows > Preferences (On OS-X menu: Eclipse > Preferences)
  • The Preferences dialog opens
  • Select from the tree on the left: Java > Editor > Content Assist > Favorites
  • Use the button New Type...
  • Now the dialog New Type Favorite is opened
  • Use the button Browse...
  • Now the dialog Type Selection is opened
  • Enter in the text field Choose type name the value Assert
  • The list Matching items shows all static classes, that are found.
  • Select the one from org.testng
  • Press the OK button
  • Press the OK button
  • The Preferences dialog should now show an extra entry in the Favorites list like org.testng.Assert.*
@missedone
Copy link
Collaborator

@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
Copy link
Collaborator

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

@missedone
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants