File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/main/java/io/openliberty/tools/intellij/lsp4jakarta/lsp4ij Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11/*******************************************************************************
2- * Copyright (c) 2020, 2025 Red Hat, Inc.
2+ * Copyright (c) 2020, 2024 Red Hat, Inc.
33 * Distributed under license by Red Hat, Inc. All rights reserved.
44 * This program is made available under the terms of the
55 * Eclipse Public License v2.0 which accompanies this distribution,
@@ -122,9 +122,19 @@ private MicroProfileJavaCompletionParams adapt(JakartaJavaCompletionParams param
122122
123123 private JavaCursorContextResult adapt (org .eclipse .lsp4mp .commons .JavaCursorContextResult contextResult ) {
124124 if (contextResult != null ) {
125- var kind = contextResult .getKind ();
126- if (kind != null )
127- return new JavaCursorContextResult (JavaCursorContextKind .forValue (kind .getValue ()), contextResult .getPrefix ());
125+ return new JavaCursorContextResult (adapt (contextResult .getKind ()), contextResult .getPrefix ());
126+ }
127+ return null ;
128+ }
129+
130+ private JavaCursorContextKind adapt (org .eclipse .lsp4mp .commons .JavaCursorContextKind kind ) {
131+ if (kind != null ) {
132+ // Workaround for an issue with JavaCursorContextKind.forValue().
133+ // See https://github.com/OpenLiberty/liberty-tools-intellij/issues/681 for details.
134+ if (kind == org .eclipse .lsp4mp .commons .JavaCursorContextKind .NONE ) {
135+ return JavaCursorContextKind .NONE ;
136+ }
137+ return JavaCursorContextKind .forValue (kind .getValue ());
128138 }
129139 return null ;
130140 }
You can’t perform that action at this time.
0 commit comments