Skip to content

Commit

Permalink
build: update minimum required IJ version to 2022.3
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon authored and angelozerr committed Jan 31, 2024
1 parent ae20b22 commit d7336b8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ pluginRepositoryUrl=https://github.com/redhat-developer/lsp4ij
# NO SPACES AROUND THE EQUALS SIGN!!
pluginVersion=0.0.1-SNAPSHOT
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=222
pluginSinceBuild=223
#pluginUntilBuild=233.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType=IC
platformVersion=2022.2.3
platformVersion=2022.3
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins=com.redhat.devtools.intellij.telemetry:1.1.0.52
# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.4
gradleVersion=8.5
channel=nightly
lsp4jVersion=0.21.1
flexmarkVersion=0.64.8
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations = "24.0.1"
testlogger = "3.2.0"
kotlin = "1.9.10"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.0"
gradleIntelliJPlugin = "1.16.1"


[libraries]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
25 changes: 8 additions & 17 deletions src/main/java/com/redhat/devtools/lsp4ij/ServerMessageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,19 @@ public static void logMessage(LanguageServerWrapper wrapper, MessageParams param
}

private static Icon messageTypeToIcon(MessageType type) {
Icon result = null;

switch (type) {
case Error:
result = AllIcons.General.Error;
break;
case Info:
case Log:
result = AllIcons.General.Information;
break;
case Warning:
result = AllIcons.General.Warning;
}
return result;
return switch (type) {
case Error -> AllIcons.General.Error;
case Info, Log -> AllIcons.General.Information;
case Warning -> AllIcons.General.Warning;
};
}

private static NotificationType messageTypeToNotificationType(MessageType type) {
NotificationType result = switch (type) {
return switch (type) {
case Error -> NotificationType.ERROR;
case Info, Log -> NotificationType.INFORMATION;
case Warning -> NotificationType.WARNING;
};
return result;
}


Expand All @@ -75,7 +65,8 @@ private static NotificationType messageTypeToNotificationType(MessageType type)
* @param params the message parameters
*/
public static void showMessage(String title, MessageParams params) {
Notification notification = new Notification(LanguageServerBundle.message("language.server.protocol.groupId"), title, toHTML(params.getMessage()), messageTypeToNotificationType(params.getType()), NotificationListener.URL_OPENING_LISTENER);
Notification notification = new Notification(LanguageServerBundle.message("language.server.protocol.groupId"), title, toHTML(params.getMessage()), messageTypeToNotificationType(params.getType()));
notification.setListener(NotificationListener.URL_OPENING_LISTENER);
notification.setIcon(messageTypeToIcon(params.getType()));
Notifications.Bus.notify(notification);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.ListCellRendererWrapper;
import com.intellij.ui.SimpleListCellRenderer;
import com.intellij.util.ui.FormBuilder;
import com.intellij.util.ui.JBInsets;
import com.redhat.devtools.lsp4ij.LanguageServerBundle;
Expand Down Expand Up @@ -82,7 +82,7 @@ public NewLanguageServerDialog(@NotNull Project project) {
private void createTemplateCombo(FormBuilder builder) {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
templateCombo.setRenderer(new ListCellRendererWrapper<LanguageServerTemplate>() {
templateCombo.setRenderer(new SimpleListCellRenderer<LanguageServerTemplate>() {
@Override
public void customize(@NotNull JList list,
@Nullable LanguageServerTemplate value,
Expand All @@ -97,7 +97,7 @@ public void customize(@NotNull JList list,
}
});

final JButton showInstructionButton = super.createHelpButton(JBInsets.emptyInsets());
final JButton showInstructionButton = super.createHelpButton(new JBInsets(0,0,0,0));
showInstructionButton.setText("");
templateCombo.addItemListener(event -> {
LanguageServerTemplate template = (LanguageServerTemplate) event.getItem();
Expand All @@ -108,8 +108,10 @@ public void customize(@NotNull JList list,

showInstructionButton.addActionListener(e -> {
LanguageServerTemplate template = (LanguageServerTemplate) templateCombo.getSelectedItem();
ShowInstructionDialog dialog = new ShowInstructionDialog(template, project);
dialog.show();
if (template != null) {
ShowInstructionDialog dialog = new ShowInstructionDialog(template, project);
dialog.show();
}
});
showInstructionButton.setEnabled(false);
panel.add(showInstructionButton, BorderLayout.CENTER);
Expand Down

0 comments on commit d7336b8

Please sign in to comment.