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 hover for package fragments #83

Closed
wants to merge 2 commits into from

Conversation

othomann
Copy link

@othomann othomann commented Oct 7, 2016

I propose these changes to add some hover contents for a package fragment. This should work for the actual package declaration of the current unit if there is a package-info.java file in the same package or for import statements when you hover on the package part of the import.
Let me know what you think.

Signed-off-by: Olivier Thomann <[email protected]>
// We need to select the one that matches the package fragment of the current unit
IJavaElement found = null;
IPackageFragment packageFragment = (IPackageFragment) unit.getParent();
loop: for (IJavaElement element : elements) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stream.of(elements)
.filter(e -> e.equals(packageFragment))
.findFirst().orElse(null);

Copy link
Contributor

@gorkem gorkem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move JavaDocCommentReader and JavadocContentAccess from the copied.* packages? They have become specific to LS with these changes.

Signed-off-by: Olivier Thomann <[email protected]>
@othomann othomann closed this Oct 7, 2016
@othomann othomann deleted the packagefragment-hover branch October 7, 2016 15:05
yaohaizh pushed a commit to yaohaizh/eclipse.jdt.ls that referenced this pull request Jul 4, 2017
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

Successfully merging this pull request may close these issues.

3 participants