Add hover for package fragments#84
Merged
Merged
Conversation
Signed-off-by: Olivier Thomann <Olivier_Thomann@ca.ibm.com>
fbricon
reviewed
Oct 7, 2016
| // return computeSourceHover(curr); | ||
| } | ||
| IJavaElement curr = null; | ||
| if (elements.length != 1) { |
Contributor
There was a problem hiding this comment.
potential IIOOBE if length == 0, L54 and L58
fbricon
reviewed
Oct 7, 2016
| * IBM Corporation - initial API and implementation | ||
| *******************************************************************************/ | ||
| package copied.org.eclipse.jdt.ui; | ||
| package org.jboss.tools.vscode.java.internal; |
Contributor
There was a problem hiding this comment.
org.jboss.tools.vscode.java.internal.javadoc?
fbricon
reviewed
Oct 7, 2016
| * IBM Corporation - initial API and implementation | ||
| *******************************************************************************/ | ||
| package copied.org.eclipse.jdt.internal.corext.javadoc; | ||
| package org.jboss.tools.vscode.java.internal.hover; |
Contributor
There was a problem hiding this comment.
org.jboss.tools.vscode.java.internal.javadoc?
fbricon
reviewed
Oct 7, 2016
| package org.jboss.tools.vscode.java.internal; | ||
|
|
||
| public class Util { | ||
|
|
Contributor
There was a problem hiding this comment.
add private constructor if it's supposed to only contain static methods
fbricon
reviewed
Oct 7, 2016
|
|
||
| public static String convertToIndependentLineDelimiter(String source) { | ||
| if (source.indexOf('\n') == -1 && source.indexOf('\r') == -1) return source; | ||
| StringBuffer buffer = new StringBuffer(); |
Signed-off-by: Olivier Thomann <Olivier_Thomann@ca.ibm.com>
Fix test Util class Signed-off-by: Olivier Thomann <Olivier_Thomann@ca.ibm.com>
fbricon
reviewed
Oct 7, 2016
| .filter(e -> e.equals(packageFragment)) | ||
| .findFirst() | ||
| .orElse(null); | ||
| if (found == null) { |
Contributor
There was a problem hiding this comment.
Why not imply test packageFragment.getKind() == IPackageFragmentRoot.K_BINARY?
Author
There was a problem hiding this comment.
Because I think this is too early to check that. It can be a package from source as well if you import a type from another package. This is a case where it doesn't match the package from the current compilation unit.
Signed-off-by: Olivier Thomann <Olivier_Thomann@ca.ibm.com>
yaohaizh
pushed a commit
to yaohaizh/eclipse.jdt.ls
that referenced
this pull request
Jul 4, 2017
adds pom.xml as workspaceContains activation Fixes eclipse-jdtls#84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
This also fixes the broken test on Windows.
I integrated all proposals from the previous PR (#83) that I closed by mistake.