Skip to content

Commit 2f3b85a

Browse files
javadoc Markdown issues (eclipse-jdt#2051)
Partition based selection handling needs to handle markdown, too. Fixes part of eclipse-jdt#1800
1 parent 6d20661 commit 2f3b85a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ protected boolean isIgnoringNewInput(IJavaElement je, IWorkbenchPart part, ISele
11591159
try {
11601160
int offset= textSel.getOffset();
11611161
String partition= ((IDocumentExtension3)document).getContentType(IJavaPartitions.JAVA_PARTITIONING, offset, false);
1162-
return !IJavaPartitions.JAVA_DOC.equals(partition);
1162+
return !IJavaPartitions.JAVA_DOC.equals(partition) && !IJavaPartitions.JAVA_MARKDOWN_COMMENT.equals(partition);
11631163
} catch (BadPartitioningException | BadLocationException ex) {
11641164
return false;
11651165
}
@@ -1199,7 +1199,8 @@ protected IJavaElement findSelectedJavaElement(IWorkbenchPart part, ISelection s
11991199

12001200
if (document != null) {
12011201
ITypedRegion typedRegion= TextUtilities.getPartition(document, IJavaPartitions.JAVA_PARTITIONING, textSelection.getOffset(), false);
1202-
if (IJavaPartitions.JAVA_DOC.equals(typedRegion.getType())){
1202+
if (IJavaPartitions.JAVA_DOC.equals(typedRegion.getType())
1203+
|| IJavaPartitions.JAVA_MARKDOWN_COMMENT.equals(typedRegion.getType())){
12031204
element= TextSelectionConverter.getElementAtOffset((JavaEditor) part, textSelection);
12041205
}
12051206
else if (editorInput instanceof IFileEditorInput fei) {

0 commit comments

Comments
 (0)