Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2025 Red Hat, Inc.
* Copyright (c) 2020, 2024 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 @@ -122,9 +122,19 @@ private MicroProfileJavaCompletionParams adapt(JakartaJavaCompletionParams param

private JavaCursorContextResult adapt(org.eclipse.lsp4mp.commons.JavaCursorContextResult contextResult) {
if (contextResult != null) {
var kind = contextResult.getKind();
if(kind != null)
return new JavaCursorContextResult(JavaCursorContextKind.forValue(kind.getValue()), contextResult.getPrefix());
return new JavaCursorContextResult(adapt(contextResult.getKind()), contextResult.getPrefix());
}
return null;
}

private JavaCursorContextKind adapt(org.eclipse.lsp4mp.commons.JavaCursorContextKind kind) {
if (kind != null) {
// Workaround for an issue with JavaCursorContextKind.forValue().
// See https://github.com/OpenLiberty/liberty-tools-intellij/issues/681 for details.
if (kind == org.eclipse.lsp4mp.commons.JavaCursorContextKind.NONE) {
return JavaCursorContextKind.NONE;
}
return JavaCursorContextKind.forValue(kind.getValue());
}
return null;
}
Expand Down
Loading