Skip to content

Commit ead4c41

Browse files
Merge remote-tracking branch 'upstream/main' into constants#1153
2 parents 7e757c1 + 73683c7 commit ead4c41

File tree

59 files changed

+2488
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2488
-398
lines changed

.github/workflows/build.yaml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,61 @@ jobs:
9393
build:
9494
needs: fetch_merge_commit_sha_from_lsp4ij_PR
9595
runs-on: ${{ matrix.os }}
96+
name: ${{ matrix.runtime }} - ${{ matrix.test-group }}
9697
strategy:
9798
fail-fast: false
9899
matrix:
99100
runtime: [ linux, mac, windows ]
101+
test-group: [ LSP4Jakarta-Unit, Maven-MicroProfile, Gradle-MicroProfile, Maven-Custom-Liberty-Install, Gradle-Custom-Liberty-Install, Maven-MP-Config, Gradle-MP-Config, Maven-MP-SID, Gradle-MP-SID, Maven-NLT-REST, Gradle-NLT-REST, Gradle-Language-Server, Gradle-MP-Language-Server, Gradle-Jakarta-Language-Server, Maven-Multi-Module-MP ]
102+
exclude:
103+
# Exclude LSP4Jakarta-Unit from mac and windows - only run on linux
104+
- runtime: mac
105+
test-group: LSP4Jakarta-Unit
106+
- runtime: windows
107+
test-group: LSP4Jakarta-Unit
100108
include:
101109
- runtime: linux
102110
os: ubuntu-latest
103-
reportName: linux-test-report
104111
- runtime: mac
105-
os: macOS-latest
106-
reportName: mac-test-report
112+
os: macOS-14
107113
- runtime: windows
108114
os: windows-latest
109-
reportName: windows-test-report
115+
- test-group: Maven-MicroProfile
116+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPProjectTest
117+
- test-group: Gradle-MicroProfile
118+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPProjectTest
119+
- test-group: Maven-Custom-Liberty-Install
120+
test-class: io.openliberty.tools.intellij.it.MavenSingleModCustomWLPInstallProjectTest
121+
- test-group: Gradle-Custom-Liberty-Install
122+
test-class: io.openliberty.tools.intellij.it.GradleSingleModCustomWLPInstallProjectTest
123+
- test-group: Maven-MP-Config
124+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPCfgProjectTest
125+
- test-group: Gradle-MP-Config
126+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPCfgProjectTest
127+
- test-group: Maven-MP-SID
128+
test-class: io.openliberty.tools.intellij.it.MavenSingleModMPSIDProjectTest
129+
- test-group: Gradle-MP-SID
130+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPSIDProjectTest
131+
- test-group: Maven-NLT-REST
132+
test-class: io.openliberty.tools.intellij.it.MavenSingleModNLTRestProjectTest
133+
- test-group: Gradle-NLT-REST
134+
test-class: io.openliberty.tools.intellij.it.GradleSingleModNLTRestProjectTest
135+
- test-group: Gradle-Language-Server
136+
test-class: io.openliberty.tools.intellij.it.GradleSingleModLSTest
137+
- test-group: Gradle-MP-Language-Server
138+
test-class: io.openliberty.tools.intellij.it.GradleSingleModMPLSTest
139+
- test-group: Gradle-Jakarta-Language-Server
140+
test-class: io.openliberty.tools.intellij.it.GradleSingleModJakartaLSTest
141+
- test-group: Maven-Multi-Module-MP
142+
test-class: io.openliberty.tools.intellij.it.MavenMPMultipleProjectTest
143+
- test-group: LSP4Jakarta-Unit
144+
test-class: "io.openliberty.tools.intellij.lsp4jakarta.it.*"
110145
env:
111146
USE_LOCAL_PLUGIN: ${{ inputs.useLocalPlugin || false }}
112147
REF_LSP4IJ: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.pr_details }}
113148
LSP4IJ_BRANCH: ${{ needs.fetch_merge_commit_sha_from_lsp4ij_PR.outputs.checkout_name }}
114149
REF_LTI_TAG: ${{ inputs.refLTITag }}
150+
TEST_CLASS: ${{ matrix.test-class }}
115151
steps:
116152
- name: Configure pagefile
117153
if: contains(matrix.os, 'windows')
@@ -152,7 +188,7 @@ jobs:
152188
working-directory: ./liberty-tools-intellij
153189
run: bash ./gradlew buildPlugin -PuseLocal=${{ env.USE_LOCAL_PLUGIN }}
154190
- name: 'Archive artifacts'
155-
if: ${{ runner.os == 'Linux' && !failure() }}
191+
if: ${{ runner.os == 'Linux' && matrix.test-group == 'LSP4Jakarta-Unit' && !failure() }}
156192
uses: actions/[email protected]
157193
with:
158194
name: liberty-tools-intellij-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
@@ -161,14 +197,14 @@ jobs:
161197
./**/libs/*liberty-tools-intellij*.jar
162198
if-no-files-found: warn
163199
retention-days: 7
164-
- name: 'Run UI integration tests'
200+
- name: 'Run tests'
165201
id: run_tests
166202
working-directory: ./liberty-tools-intellij
167203
run: bash ./src/test/resources/ci/scripts/run.sh
168204
- name: 'Archive Test logs and reports'
169205
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
170206
uses: actions/[email protected]
171207
with:
172-
name: ${{ matrix.reportName }}-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
208+
name: ${{ matrix.runtime }}-${{ matrix.test-group }}-test-report-LTI-${{ env.REF_LTI_TAG || 'default' }}-LSP4IJ-${{ env.LSP4IJ_BRANCH || 'default' }}
173209
path: |
174210
liberty-tools-intellij/build/reports/

build.gradle

Lines changed: 7 additions & 5 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.7.2'
6+
id 'org.jetbrains.intellij.platform' version '2.10.1'
77
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
88
}
99

1010
group 'io.openliberty.tools'
11-
version '25.0.9'
11+
version '25.0.12-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)
@@ -178,7 +178,7 @@ task copyDeps(type: Copy) {
178178
intellijPlatformTesting.runIde {
179179
runIdeLocally {
180180
version = providers.gradleProperty("ideTargetVersion")
181-
type = IntelliJPlatformType.IntellijIdeaCommunity
181+
type = IntelliJPlatformType.IntellijIdea
182182
task {
183183
jvmArgumentProviders.add({
184184
[
@@ -203,7 +203,7 @@ test {
203203
intellijPlatformTesting.runIde {
204204
runIdeForUiTests {
205205
version = providers.gradleProperty("ideTargetVersion")
206-
type = IntelliJPlatformType.IntellijIdeaCommunity
206+
type = IntelliJPlatformType.IntellijIdea
207207
task {
208208
jvmArgumentProviders.add({
209209
[
@@ -216,6 +216,8 @@ intellijPlatformTesting.runIde {
216216
"-Dide.mac.file.chooser.native=false",
217217
"-DjbScreenMenuBar.enabled=false",
218218
"-Dapple.laf.useScreenMenuBar=false",
219+
// This disables the EAP login prompt:
220+
"-Deap.require.license=release"
219221
]
220222
} as CommandLineArgumentProvider)
221223
systemProperty("ide.native.launcher", "true")
@@ -231,7 +233,7 @@ intellijPlatform {
231233
pluginConfiguration {
232234
ideaVersion {
233235
sinceBuild = providers.gradleProperty("pluginSinceBuild")
234-
untilBuild = providers.gradleProperty("pluginUntilBuild")
236+
untilBuild = provider { null }
235237
}
236238
changeNotes = """
237239
<h2> 25.0.9 </h2>

gradle.properties

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

54
javaVersion=21
65

76
# Target IntelliJ Community by default
8-
platformType=IC
7+
platformType=IU
98
platformVersion=2024.3.6
10-
ideTargetVersion=2025.2.1
9+
ideTargetVersion=253.28294.251
1110

1211
# Example: platformBundledPlugins = com.intellij.java
1312
platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij.gradle, org.jetbrains.plugins.terminal, com.intellij.properties
1413

1514
# Version numbers of dependencies
16-
lsp4JakartaVersion=0.2.3
15+
lsp4JakartaVersion=0.2.5
1716
lsp4mpVersion=0.13.0
1817
lemminxVersion=0.26.1
1918
lclsLemminxVersion=2.4

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/io/openliberty/tools/intellij/LibertyExplorer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import com.intellij.ide.DataManager;
1313
import com.intellij.openapi.actionSystem.*;
14+
import com.intellij.openapi.actionSystem.ex.ActionUtil;
1415
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
1516
import com.intellij.openapi.application.ApplicationManager;
1617
import com.intellij.openapi.application.ModalityState;
@@ -284,9 +285,10 @@ private static void executeAction(Tree tree) {
284285
}
285286
LibertyGeneralAction action = (LibertyGeneralAction) am.getAction(actionId);
286287
if (action != null) {
287-
action.actionPerformed(new AnActionEvent(DataManager.getInstance().getDataContext(tree),
288+
AnActionEvent event = new AnActionEvent(DataManager.getInstance().getDataContext(tree),
288289
new Presentation(), ActionPlaces.UNKNOWN, ActionUiKind.NONE, null,
289-
0, am));
290+
0, am);
291+
ActionUtil.performActionDumbAwareWithCallbacks(action, event);
290292
}
291293
}
292294
}

src/main/java/io/openliberty/tools/intellij/actions/RunLibertyDevTask.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2020, 2024 IBM Corporation.
2+
* Copyright (c) 2020, 2025 IBM Corporation.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -11,6 +11,7 @@
1111

1212
import com.intellij.ide.DataManager;
1313
import com.intellij.openapi.actionSystem.*;
14+
import com.intellij.openapi.actionSystem.ex.ActionUtil;
1415
import com.intellij.openapi.diagnostic.Logger;
1516
import com.intellij.openapi.project.Project;
1617
import com.intellij.openapi.wm.ToolWindow;
@@ -81,7 +82,8 @@ private void handleLibertyTreeEvent(@NotNull AnActionEvent e, Project project, b
8182
} else {
8283
// calls selected action
8384
AnAction action = ActionManager.getInstance().getAction(Constants.FULL_ACTIONS_MAP.get(lastPathComponent));
84-
action.actionPerformed(new AnActionEvent(DataManager.getInstance().getDataContext(libertyTree), e.getPresentation(), e.getPlace(), ActionUiKind.NONE, null, 0, ActionManager.getInstance()));
85+
AnActionEvent event = new AnActionEvent(DataManager.getInstance().getDataContext(libertyTree), e.getPresentation(), e.getPlace(), ActionUiKind.NONE, null, 0, ActionManager.getInstance());
86+
ActionUtil.performActionDumbAwareWithCallbacks(action, event);
8587
}
8688
}
8789
}
@@ -117,7 +119,8 @@ public void actionPerformed(@NotNull AnActionEvent e) {
117119
String selectedAction = libertyActions[ret];
118120
// run selected action
119121
AnAction action = ActionManager.getInstance().getAction(Constants.FULL_ACTIONS_MAP.get(selectedAction));
120-
action.actionPerformed(new AnActionEvent(e.getDataContext(), e.getPresentation(), e.getPlace(), ActionUiKind.NONE, null, 0, ActionManager.getInstance()));
122+
AnActionEvent event = new AnActionEvent(e.getDataContext(), e.getPresentation(), e.getPlace(), ActionUiKind.NONE, null, 0, ActionManager.getInstance());
123+
ActionUtil.performActionDumbAwareWithCallbacks(action, event);
121124
}
122125
} else {
123126
handleLibertyTreeEvent(e, project, false);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 IBM Corporation
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0.
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*
10+
* Contributors:
11+
* IBM Corporation - initial API and implementation
12+
*******************************************************************************/
13+
14+
package io.openliberty.tools.intellij.lsp4jakarta.lsp4ij;
15+
16+
import com.intellij.openapi.project.Project;
17+
import com.intellij.psi.*;
18+
import com.intellij.psi.search.GlobalSearchScope;
19+
20+
/**
21+
* Utility class for common IntelliJ PSI-based diagnostic logic.
22+
*/
23+
public class DiagnosticsUtils {
24+
25+
/**
26+
* inheritsFrom
27+
* Check if specified superType is present or not in the type hierarchy
28+
*
29+
* @param clazz
30+
* @param fqSuperType
31+
* @return
32+
*/
33+
public static boolean inheritsFrom(PsiClass clazz, String fqSuperType) {
34+
Project project = clazz.getProject();
35+
PsiClass superClass = JavaPsiFacade.getInstance(project)
36+
.findClass(fqSuperType, GlobalSearchScope.allScope(project));
37+
return superClass != null &&
38+
(clazz.isEquivalentTo(superClass) || clazz.isInheritor(superClass, true));
39+
}
40+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 IBM Corporation and others.
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
*
9+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package io.openliberty.tools.intellij.lsp4jakarta.lsp4ij;
15+
16+
import java.util.regex.Matcher;
17+
import java.util.regex.Pattern;
18+
19+
import com.intellij.psi.PsiAnnotation;
20+
import com.intellij.psi.PsiAnnotationMemberValue;
21+
import io.openliberty.tools.intellij.lsp4jakarta.lsp4ij.jsonb.JsonbConstants;
22+
23+
24+
/**
25+
* Utilities for working with JSON properties and extracting/decoding values from its attribute, annotation etc.
26+
*/
27+
public class JsonPropertyUtils {
28+
29+
/**
30+
* @param propertyName
31+
* @return String
32+
* @description Method decodes unicode property name value to string value
33+
*/
34+
public static String decodeUnicodeName(String propertyName) {
35+
Pattern pattern = Pattern.compile(JsonbConstants.JSONB_PROPERTYNAME_UNICODE); // Pattern for detecting unicode sequence
36+
Matcher matcher = pattern.matcher(propertyName);
37+
StringBuffer decoded = new StringBuffer();
38+
while (matcher.find()) {
39+
String unicode = matcher.group(1);
40+
char decodedChar = (char) Integer.parseInt(unicode, 16);
41+
matcher.appendReplacement(decoded, Character.toString(decodedChar));
42+
}
43+
matcher.appendTail(decoded);
44+
return decoded.toString();
45+
}
46+
47+
/**
48+
* @param annotation
49+
* @return String
50+
* @description Method extracts property name value from the annotation
51+
*/
52+
public static String extractPropertyNameFromJsonField(PsiAnnotation annotation) {
53+
PsiAnnotationMemberValue psiValue = annotation.findAttributeValue("value");
54+
String value = psiValue != null ? psiValue.getText() : null;
55+
// Remove wrapping quotes if it's a string literal
56+
if (value != null && value.startsWith("\"") && value.endsWith("\"")) {
57+
value = value.substring(1, value.length() - 1);
58+
}
59+
return value;
60+
}
61+
}

src/main/java/io/openliberty/tools/intellij/lsp4jakarta/lsp4ij/annotations/AnnotationConstants.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2021, 2022 IBM Corporation and others.
2+
* Copyright (c) 2021, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -44,4 +44,8 @@ public class AnnotationConstants {
4444
public static final String DIAGNOSTIC_CODE_PREDESTROY_PARAMS = "PreDestroyParams";
4545
public static final String DIAGNOSTIC_CODE_PREDESTROY_EXCEPTION = "PreDestroyException";
4646
public static final String DIAGNOSTIC_CODE_PREDESTROY_STATIC = "PreDestroyStatic";
47+
48+
/* Exceptions */
49+
public static final String EXCEPTION = "java.lang.Exception";
50+
public static final String RUNTIME_EXCEPTION = "java.lang.RuntimeException";
4751
}

0 commit comments

Comments
 (0)