Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ configurations {
}

dependencies {

implementation ("org.eclipse.lsp4mp:org.eclipse.lsp4mp.ls:$lsp4mpVersion") {
exclude group: 'org.eclipse.lsp4j'
exclude group: 'com.google.code.gson'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij

# Version numbers of dependencies
lsp4JakartaVersion=0.2.3
lsp4mpVersion=0.13.0
lsp4mpVersion=0.14.1
lemminxVersion=0.26.1
lclsLemminxVersion=2.2.1
lclsVersion=2.2.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2024 Red Hat, Inc.
* Copyright (c) 2020, 2025 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution,
Expand Down Expand Up @@ -139,7 +139,7 @@ public JavaCursorContextResult javaCursorContext(MicroProfileJavaCompletionParam
PsiElement firstClass = javaFile.getClasses()[0];

if (completionOffset <= firstClass.getTextOffset()) {
return JavaCursorContextKind.BEFORE_CLASS;
return JavaCursorContextKind.BEFORE_TOP_LEVEL_CLASS;
}

return JavaCursorContextKind.NONE;
Expand All @@ -153,7 +153,7 @@ public JavaCursorContextResult javaCursorContext(MicroProfileJavaCompletionParam
PsiAnnotation psiAnnotation = (PsiAnnotation) parent;
@Nullable PsiAnnotationOwner annotationOwner = psiAnnotation.getOwner();
if (annotationOwner instanceof PsiClass) {
return (psiAnnotation.getStartOffsetInParent() == 0)? JavaCursorContextKind.BEFORE_CLASS:JavaCursorContextKind.IN_CLASS_ANNOTATIONS;
return (psiAnnotation.getStartOffsetInParent() == 0)? JavaCursorContextKind.BEFORE_INNER_CLASS:JavaCursorContextKind.IN_CLASS_ANNOTATIONS;
}
if (annotationOwner instanceof PsiMethod){
return (psiAnnotation.getStartOffsetInParent() == 0)? JavaCursorContextKind.BEFORE_METHOD:JavaCursorContextKind.IN_METHOD_ANNOTATIONS;
Expand Down Expand Up @@ -196,14 +196,14 @@ public JavaCursorContextResult javaCursorContext(MicroProfileJavaCompletionParam
@NotNull
private static JavaCursorContextKind getContextKindFromClass(int completionOffset, PsiClass psiClass, PsiElement element) {
if (completionOffset <= psiClass.getTextRange().getStartOffset()) {
return JavaCursorContextKind.BEFORE_CLASS;
return JavaCursorContextKind.BEFORE_TOP_LEVEL_CLASS;
}
int classStartOffset = getClassStartOffset(psiClass);
if (completionOffset <= classStartOffset) {
if (psiClass.getAnnotations().length > 0) {
return JavaCursorContextKind.IN_CLASS_ANNOTATIONS;
}
return JavaCursorContextKind.BEFORE_CLASS;
return JavaCursorContextKind.BEFORE_TOP_LEVEL_CLASS;
}

PsiElement nextElement = element.getNextSibling();
Expand All @@ -215,7 +215,7 @@ private static JavaCursorContextKind getContextKindFromClass(int completionOffse
return JavaCursorContextKind.BEFORE_METHOD;
}
if (nextElement instanceof PsiClass) {
return JavaCursorContextKind.BEFORE_CLASS;
return JavaCursorContextKind.BEFORE_INNER_CLASS;
}

return JavaCursorContextKind.IN_CLASS;
Expand Down
Loading