-
Notifications
You must be signed in to change notification settings - Fork 392
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
Intellisense does not work when attached javadoc can't be read #1314
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>aspose</groupId> | ||
<artifactId>aspose</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.aspose</groupId> | ||
<artifactId>aspose-words</artifactId> | ||
<version>15.12.0</version> | ||
<classifier>jdk16</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.aspose</groupId> | ||
<artifactId>aspose-words</artifactId> | ||
<version>15.12.0</version> | ||
<classifier>javadoc</classifier> | ||
</dependency> | ||
</dependencies> | ||
|
||
<repositories> | ||
<repository> | ||
<id>AsposeJavaAPI</id> | ||
<name>Aspose Java API</name> | ||
<url>https://repository.aspose.com/repo/</url> | ||
</repository> | ||
</repositories> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
org.eclipse.jdt.ls.tests/projects/maven/aspose/src/main/java/org/sample/TestJavadoc.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.sample; | ||
|
||
import java.io.File; | ||
|
||
import com.aspose.words.Document; | ||
public final class TestJavadoc { | ||
public static void main(String[] args) throws Exception { | ||
File file = File.createTempFile("test", "txt"); | ||
Document doc = new Document(file.getAbsolutePath()); | ||
doc. | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ | |
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.resources.ResourcesPlugin; | ||
import org.eclipse.core.runtime.NullProgressMonitor; | ||
import org.eclipse.core.runtime.Path; | ||
import org.eclipse.core.runtime.jobs.Job; | ||
|
@@ -2563,6 +2565,28 @@ public void testCompletion_FilterTypesKeepMethods() throws JavaModelException { | |
} | ||
} | ||
|
||
@Test | ||
public void testCompletion_InvalidJavadoc() throws Exception { | ||
importProjects("maven/aspose"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make the project folder name to be consistent with the artifact id There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
IProject project = null; | ||
ICompilationUnit unit = null; | ||
try { | ||
project = ResourcesPlugin.getWorkspace().getRoot().getProject("aspose"); | ||
IJavaProject javaProject = JavaCore.create(project); | ||
unit = (ICompilationUnit) javaProject.findElement(new Path("org/sample/TestJavadoc.java")); | ||
unit.becomeWorkingCopy(null); | ||
int[] loc = findCompletionLocation(unit, "doc."); | ||
CompletionParams position = JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1])); | ||
CompletionList list = server.completion(position).join().getRight(); | ||
CompletionItem ci = list.getItems().stream().filter(item -> item.getLabel().equals("accept(DocumentVisitor visitor) : boolean")).findFirst().orElse(null); | ||
assertNotNull(ci); | ||
} finally { | ||
if (unit != null) { | ||
unit.discardWorkingCopy(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void testCompletion_ConstantDefaultValue() throws JavaModelException { | ||
ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build, reporting and profiles sections are not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.