Skip to content

Commit 5bbaaed

Browse files
committed
fix: update the code
1 parent 19fb8bf commit 5bbaaed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/parser/ContextResolver.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ private static String extractRelevantJavaDocContent(org.eclipse.jdt.core.IType t
919919
while (markdownMatcher.find()) {
920920
String code = markdownMatcher.group(1).trim();
921921
if (isNotEmpty(code) && seenCodeSnippets.add(code)) {
922-
result.append("Example:\n```java\n").append(code).append("\n```\n\n");
922+
result.append("```java\n").append(code).append("\n```\n\n");
923923
}
924924
}
925925

@@ -929,7 +929,7 @@ private static String extractRelevantJavaDocContent(org.eclipse.jdt.core.IType t
929929
while (preMatcher.find()) {
930930
String code = preMatcher.group(1).replaceAll("(?i)<code[^>]*>", "").replaceAll("(?i)</code>", "").trim();
931931
if (isNotEmpty(code) && seenCodeSnippets.add(code)) {
932-
result.append("Example:\n```java\n").append(code).append("\n```\n\n");
932+
result.append("```java\n").append(code).append("\n```\n\n");
933933
}
934934
}
935935

@@ -939,7 +939,7 @@ private static String extractRelevantJavaDocContent(org.eclipse.jdt.core.IType t
939939
String code = codeMatcher.group(1).trim();
940940
// Use HashSet for O(1) duplicate checking
941941
if (isNotEmpty(code) && seenCodeSnippets.add(code)) {
942-
result.append("Example:\n```java\n").append(code).append("\n```\n\n");
942+
result.append("```java\n").append(code).append("\n```\n\n");
943943
}
944944
}
945945

@@ -969,14 +969,14 @@ private static String extractClassDescription(String cleanedJavadoc) {
969969
// Extract description before @tags
970970
String description = extractJavadocDescription(textOnly);
971971

972-
// Limit to first 2-3 sentences or ~200 characters
973-
if (description.length() > 200) {
974-
int breakPoint = findBestBreakpoint(description, 100, 250);
972+
// Limit to ~2000 characters
973+
if (description.length() > 2000) {
974+
int breakPoint = findBestBreakpoint(description, 1500, 2100);
975975
if (breakPoint != -1) {
976976
description = description.substring(0, breakPoint + 1).trim();
977977
} else {
978-
int lastSpace = description.lastIndexOf(' ', 200);
979-
description = description.substring(0, lastSpace > 100 ? lastSpace : 200).trim() + "...";
978+
int lastSpace = description.lastIndexOf(' ', 2000);
979+
description = description.substring(0, lastSpace > 1500 ? lastSpace : 2000).trim() + "...";
980980
}
981981
}
982982

0 commit comments

Comments
 (0)