I'm trying to find sample code examples that involve a certain package. If I can do so I can show where this particular packages was used previously by others.
Is there anyway to do this?
The Package in question is SwingBuilders which 'belongs' to JavaBuilders.
In short the question I want to answer, which projects have used the SwingBuilders package on GitHub?
Best Answer
You can with various filters.
Search for the package name or the class name you want to see example code using.
On the side, click on Code and this will filter results to show you just the source code, not repositories (which is the default search result view).
If the framework, package or module you're looking for shares a name with something else in another language, filter by selecting the language.
If from looking at the search results you see words you don't think are indicative of the examples you want to review, add
NOT word-to-exclude
as part of the search string.For example, we'll look for example code using SwingBuilder.
This returns two repositories. But we want code, so after clicking on Code now we have 3214 code results.
But that mixes in Groovy and Java. Let's narrow down with Java from the Languages list on the side. 728 results now.
But some of the results have "test" in them, and we don't want that. Change the search to:
Since the search filters don't carry sometimes, you may have to repeat the Code/Language filtering to get back to where you were.
This should now improve the type of results when looking for example code.