Skip to content

Commit b647e20

Browse files
committed
Merge branch 'lsp4jakarta-0.2.5-integration' into bugfix/defect-580
2 parents cd2d3b6 + b6bbe6d commit b647e20

File tree

14 files changed

+78
-39
lines changed

14 files changed

+78
-39
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ on:
4747
push:
4848
branches: '**'
4949
pull_request:
50-
branches: [ main ]
50+
branches: [ main, lsp4jakarta-0.2.5-integration ]
5151

5252
jobs:
5353
fetch_merge_commit_sha_from_lsp4ij_PR:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Liberty Tools for IntelliJ IDEA
22

33
<!-- Make sure to also update the #Requirements section below, and in user-guide.md -->
4-
> Note: Version 25.0.5 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**.
4+
> Note: Version 25.0.8 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**.
55
>
66
> This page provides an overview of Liberty Tools for IntelliJ IDEA.
77
> For minimum requirements information and detailed instructions on how to use Liberty Tools, check the [user-guide](docs/user-guide.md).
@@ -106,7 +106,7 @@ If you experience a problem with this plugin you might be asked to collect langu
106106

107107
## Requirements
108108
<!-- Make sure to also update the note at the top of this file, and in user-guide.md -->
109-
Version 25.0.5 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**.
109+
Version 25.0.8 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**.
110110

111111
For more details, check the [user guide](docs/user-guide.md#software-requirements).
112112

build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
44
plugins {
55
id 'java'
6-
id 'org.jetbrains.intellij.platform' version '2.3.0'
6+
id 'org.jetbrains.intellij.platform' version '2.7.2'
77
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
88
}
99

1010
group 'io.openliberty.tools'
11-
version '25.0.5'
11+
version '25.0.9-SNAPSHOT'
1212

1313
def remoteRobotVersion = "0.11.23"
1414
// To switch to nightly version, append "@nightly" to the version number (i.e. 0.4.1-20240828-013108@nightly)
@@ -234,6 +234,18 @@ intellijPlatform {
234234
untilBuild = providers.gradleProperty("pluginUntilBuild")
235235
}
236236
changeNotes = """
237+
<h2> 25.0.8 </h2>
238+
<p>Version 25.0.8 of Liberty Tools for IntelliJ IDEA contains a workaroud for a bug in the IntelliJ IDEA 2025.1.x fix stream. Version 25.0.8 requires IntelliJ IDEA version 2024.2.*, 2024.3.*, or 2025.1.* and a minimum of Java 17.</p>
239+
<ul>
240+
<li> Workaround for NullPointerException that occurs during application startup when using Liberty Tools with a fresh installation of IntelliJ IDEA 2025.1.2 or higher in the 2025.1.x fix stream. </li>
241+
<li> Liberty Tools version 25.0.8 has been tested with <a href="https://github.com/redhat-developer/lsp4ij">LSP4IJ</a> version 0.14.2.
242+
<ul>
243+
<li> For more information regarding tested LSP4IJ versions, refer to the table in <a href="https://github.com/OpenLiberty/liberty-tools-intellij/blob/main/docs/user-guide.md#manually-install-specific-release-of-the-lsp4ij-plugin-from-the-marketplace">this section</a> of the user guide.
244+
</ul>
245+
</li>
246+
</ul>
247+
See the <a href="https://github.com/OpenLiberty/liberty-tools-intellij/compare/25.0.5...25.0.8">commit log</a> for the full set of changes since the previous release.
248+
<br>
237249
<h2> 25.0.5 </h2>
238250
<p>Version 25.0.5 of Liberty Tools for IntelliJ IDEA contains enhancements and fixes. Version 25.0.5 requires IntelliJ IDEA version 2024.2.*, 2024.3.*, or 2025.1.* and a minimum of Java 17.</p>
239251
Notable changes:

docs/user-guide.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ For information regarding known issues and limitations, refer to our [Common Iss
77
- [Software requirements](#software-requirements)
88
- [Application requirements](#application-requirements)
99
- [Settings](#settings)
10-
- [Manually install specific release of the LSP4IJ plugin from the Marketplace](#manually-install-specific-release-of-the-lsp4ij-plugin-from-the-marketplace)
10+
- [LSP4IJ plugin](#lsp4ij-plugin)
11+
- [LSP4IJ tested versions](#lsp4ij-tested-versions)
12+
- [Manually install specific release of the LSP4IJ plugin from the Marketplace](#manually-install-specific-release-of-the-lsp4ij-plugin-from-the-marketplace)
13+
- [Third party language servers](#third-party-language-servers)
1114
- [Open the Liberty tool window](#open-the-liberty-tool-window)
1215
- [Run your application on Liberty using dev mode](#run-your-application-on-liberty-using-dev-mode)
1316
- [Use the Liberty tool window](#use-the-liberty-tool-window)
@@ -29,7 +32,7 @@ For information regarding known issues and limitations, refer to our [Common Iss
2932
## Before you begin
3033
### Software requirements
3134
<!-- Make sure to also update the main README.md note at its top, and its #Requirements section -->
32-
- Version 25.0.5 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**. Liberty Tools for IntelliJ IDEA is compatible with the Community Edition of IntelliJ IDEA.
35+
- Version 25.0.8 requires **IntelliJ IDEA 2024.2.\***, **2024.3.\***, or **2025.1.\*** and a minimum of **Java 17**. Liberty Tools for IntelliJ IDEA is compatible with the Community Edition of IntelliJ IDEA.
3336
- **Java 17** or later. If you change the IntelliJ IDEA Boot Java Runtime through the **Change Boot Java Runtime for the IDE** preference, ensure that you are using Java 17 or later.
3437
- [Liberty Tools for IntelliJ IDEA plugin](https://plugins.jetbrains.com/plugin/14856-liberty-tools/)
3538

@@ -51,19 +54,23 @@ Liberty Tools for IntelliJ IDEA honors the following settings:
5154
#### Environment Variables:
5255
- The **JAVA_HOME** system environment variable in the current terminal is used when you run Liberty dev mode in any project.
5356

54-
## Manually install specific release of the LSP4IJ plugin from the Marketplace
57+
## LSP4IJ plugin
58+
Liberty Tools for IntelliJ has an external dependency on [LSP4IJ](https://github.com/redhat-developer/lsp4ij), which is automatically installed from the JetBrains Marketplace when Liberty Tools is installed. LSP4IJ is a free and open-source IntelliJ plugin that enables Language Server Protocol (LSP) support for language server integration in IntelliJ IDEA.
5559

56-
When installing the Liberty Tools for IntelliJ plugin, the latest version of LSP4IJ from the JetBrains marketplace will be installed by default.
57-
58-
If you prefer to use an older version of LSP4IJ (e.g., a specific version that was tested with the Liberty Tools release you are using), you can manually downgrade it by installing the desired version as a dependency from the [JetBrains marketplace](https://plugins.jetbrains.com/plugin/23257-lsp4ij/versions).
60+
### LSP4IJ tested versions
5961

6062
| Liberty Tools version | LSP4IJ version(s) tested |
6163
|-----------------------|----------------------------------------------|
6264
| 24.0.9 | 0.5.0, 0.6.0, 0.7.0, 0.8.1 |
6365
| 24.0.12 | 0.8.1, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0 |
6466
| 25.0.5 | 0.13.0, 0.14.0, 0.14.2 |
65-
| 25.0.8 | 0.15.0 |
67+
| 25.0.8 | 0.14.2, 0.15.0 |
68+
69+
### Manually install specific release of the LSP4IJ plugin from the Marketplace
70+
71+
When installing the Liberty Tools for IntelliJ plugin, the latest version of LSP4IJ from the JetBrains marketplace will be installed by default.
6672

73+
If you prefer to use an older version of LSP4IJ (e.g., a specific version that was tested with the Liberty Tools release you are using), you can manually downgrade it by installing the desired version as a dependency from the [JetBrains marketplace](https://plugins.jetbrains.com/plugin/23257-lsp4ij/versions).
6774

6875
Steps to install an older version of LSP4IJ:
6976
1. Go to the Plugins tab in the IDE Settings and uninstall the latest version.
@@ -77,6 +84,16 @@ Steps to install an older version of LSP4IJ:
7784

7885
5. Confirm by clicking OK, then apply the changes. If prompted, restart your IDE.
7986

87+
### Third party language servers
88+
LSP4IJ includes a built-in installer that may prompt users to install additional third-party language servers. While users are free to explore and install these language servers, Liberty Tools **only supports the following officially bundled language servers**:
89+
90+
- [Liberty Config Language Server](https://github.com/OpenLiberty/liberty-language-server)
91+
- [Liberty LemMinX Language Server](https://github.com/OpenLiberty/liberty-language-server)
92+
- [Eclipse LSP4Jakarta: Language Server for Jakarta EE](https://github.com/eclipse/lsp4jakarta)
93+
- [Eclipse LSP4MP: Language Server for MicroProfile](https://github.com/eclipse/lsp4mp)
94+
95+
Third-party language servers installed via LSP4IJ are **not supported** by Liberty Tools. Any issues or unexpected behaviour resulting from such third-party tools fall outside the scope of Liberty Tools support. **The Liberty Tools team is not responsible for troubleshooting or resolving problems caused by third-party language servers.**
96+
8097
## Open the Liberty tool window
8198
Select **View > Tool Windows > Liberty**.
8299

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
useLocal=false
2-
pluginSinceBuild=242
3-
pluginUntilBuild=251.*
2+
pluginSinceBuild=243
3+
pluginUntilBuild=252.*
44

55
javaVersion=21
66

77
# Target IntelliJ Community by default
88
platformType=IC
9-
platformVersion=2024.2.5
10-
ideTargetVersion=2025.1
9+
platformVersion=2024.3.6
10+
ideTargetVersion=2025.2.1
1111

1212
# Example: platformBundledPlugins = com.intellij.java
1313
platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij.gradle, org.jetbrains.plugins.terminal, com.intellij.properties
@@ -17,4 +17,4 @@ lsp4JakartaVersion=0.2.3
1717
lsp4mpVersion=0.13.0
1818
lemminxVersion=0.26.1
1919
lclsLemminxVersion=2.3.2
20-
lclsVersion=2.3.2
20+
lclsVersion=2.3.2

src/main/java/io/openliberty/tools/intellij/lsp4jakarta/lsp4ij/PropertiesManagerForJakarta.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2020, 2024 Red Hat, Inc.
2+
* Copyright (c) 2020, 2025 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,19 +122,9 @@ private MicroProfileJavaCompletionParams adapt(JakartaJavaCompletionParams param
122122

123123
private JavaCursorContextResult adapt(org.eclipse.lsp4mp.commons.JavaCursorContextResult contextResult) {
124124
if (contextResult != null) {
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());
125+
var kind = contextResult.getKind();
126+
if(kind != null)
127+
return new JavaCursorContextResult(JavaCursorContextKind.forValue(kind.getValue()), contextResult.getPrefix());
138128
}
139129
return null;
140130
}

src/main/java/io/openliberty/tools/intellij/util/LibertyProjectUtil.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import javax.xml.parsers.ParserConfigurationException;
3535
import java.io.File;
3636
import java.io.IOException;
37+
import java.lang.reflect.InvocationTargetException;
38+
import java.lang.reflect.Method;
3739
import java.util.*;
3840
import java.util.concurrent.Callable;
3941
import java.util.concurrent.Future;
@@ -153,7 +155,25 @@ public static ArrayList<BuildFile> getRemovableMavenBuildFiles(Project project)
153155
*/
154156
public static ShellTerminalWidget getTerminalWidget(Project project, LibertyModule libertyModule, boolean createWidget,
155157
TerminalToolWindowManager terminalToolWindowManager, ShellTerminalWidget widget) {
158+
// Set Terminal engine to CLASSIC
156159
if (widget == null && createWidget) {
160+
try {
161+
Class<?> optionsProviderClass = Class.forName("org.jetbrains.plugins.terminal.TerminalOptionsProvider");
162+
Object optionsProviderInstance = optionsProviderClass
163+
.getMethod("getInstance")
164+
.invoke(null);
165+
166+
Class<?> terminalEngineClass = Class.forName("org.jetbrains.plugins.terminal.TerminalEngine");
167+
Object classicEngine = Enum.valueOf((Class<Enum>) terminalEngineClass, "CLASSIC");
168+
Method setEngineMethod = optionsProviderClass
169+
.getMethod("setTerminalEngine", terminalEngineClass);
170+
setEngineMethod.invoke(optionsProviderInstance, classicEngine);
171+
172+
} catch (ClassNotFoundException | NoSuchMethodException |
173+
IllegalAccessException | InvocationTargetException e) {
174+
LOGGER.error("Failed to set TerminalEngine to CLASSIC via reflection: " + e.getMessage());
175+
}
176+
157177
// create a new terminal tab
158178
ShellTerminalWidget newTerminal = ShellTerminalWidget.toShellJediTermWidgetOrThrow(
159179
terminalToolWindowManager.createShellWidget(project.getBasePath(), libertyModule.getName(),

src/test/java/io/openliberty/tools/intellij/it/UIBotTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,7 @@ public static String handleMenuBasedOnVersion(RemoteRobot remoteRobot, String me
29092909
String menuAction2;
29102910
if (intellijVersion.startsWith("2024.2")) {
29112911
menuAction2 = menuAction2024_2;
2912-
} else if (intellijVersion.startsWith("2024.3") || intellijVersion.startsWith("2025.1")) {
2912+
} else if (intellijVersion.startsWith("2024.3") || intellijVersion.startsWith("2025")) {
29132913
menuAction2 = menuAction2024_3;
29142914
} else {
29152915
// If the version is unsupported, throw an exception to indicate the issue.

src/test/java/io/openliberty/tools/intellij/it/fixtures/ProjectFrameFixture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public ComponentFixture getProjectViewTree(String... xpathVars) {
174174
public JTreeFixture getProjectViewJTree(RemoteRobot remoteRobot, String... xpathVars) {
175175
String visibleText = xpathVars[0];
176176
String intellijVersion = remoteRobot.callJs("com.intellij.openapi.application.ApplicationInfo.getInstance().getFullVersion();");
177-
String className = intellijVersion.startsWith("2025.1") ? "MyProjectViewTree" : "ProjectViewTree";
177+
String className = intellijVersion.startsWith("2025") ? "MyProjectViewTree" : "ProjectViewTree";
178178

179179
return find(JTreeFixture.class,
180180
byXpath("//div[@class='" + className + "' and contains(@visible_text, '" + visibleText + "')]"),

src/test/resources/ci/scripts/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ MAVEN_VERSION=3.8.6
3939
MAVEN_ARCHIVE_SHA512=f92dbd90060c5fd422349f844ea904a0918c9c9392f3277543ce2bfb0aab941950bb4174d9b6e2ea84cd48d2940111b83ffcc2e3acf5a5b2004277105fd22be9
4040

4141
# Gradle version control constants.
42-
GRADLE_VERSION=7.6.1
43-
GRADLE_ARCHIVE_SHA256=6147605a23b4eff6c334927a86ff3508cb5d6722cd624c97ded4c2e8640f1f87
42+
GRADLE_VERSION=8.7
43+
GRADLE_ARCHIVE_SHA256=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
4444

4545
# Software install directory.
4646
SOFTWARE_INSTALL_DIR="${PWD}/test-tools/liberty-dev-tools"

0 commit comments

Comments
 (0)