Skip to content

Commit

Permalink
feat: Declare server icon with icon attribute
Browse files Browse the repository at this point in the history
Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr authored and fbricon committed Dec 12, 2023
1 parent f3089d3 commit 138c28b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 72 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Quarkus icon provider.
*/
public class QuarkusIconProvider extends IconProvider {
public static final Icon QUARKUS_ICON = IconLoader.findIcon("/quarkus_icon_rgb_16px_default.png", QuarkusIconProvider.class);
public static final Icon QUARKUS_ICON = QuarkusIcons.Quarkus;

@Nullable
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2023 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,
* and is available at https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package com.redhat.devtools.intellij.quarkus.lang;

import com.intellij.openapi.util.IconLoader;

import javax.swing.*;

/**
* Quarkus icons.
*/
public class QuarkusIcons {

public static final Icon Quarkus = IconLoader.findIcon("/quarkus_icon_rgb_16px_default.png", QuarkusIcons.class);

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ public static boolean isQuteLibrary(@NotNull LibraryOrderEntry libraryOrderEntry
libraryOrderEntry.getLibraryName().contains("io.quarkus.qute:qute-core:");
}

private Module findModule(VirtualFile file) {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
for (Module module : ModuleManager.getInstance(project).getModules()) {
if (ModuleUtilCore.moduleContainsFile(module, file, false)) {
return module;
}
}
}
return null;
}

@Override
public @Nullable Language getLanguage(@NotNull VirtualFile file, @NotNull Project project) {
Module module = LSPIJUtils.getModule(file, project);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/lsp4ij-quarkus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- Quarkus LSP -->
<server id="microprofile"
label="Tools for MicroProfile"
icon="com.redhat.devtools.intellij.microprofile.lang.MicroProfileIcons.MicroProfile"
class="com.redhat.devtools.intellij.quarkus.lsp.QuarkusServer"
clientImpl="com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient"
serverInterface="org.eclipse.lsp4mp.ls.api.MicroProfileLanguageServerAPI"
Expand All @@ -23,7 +24,6 @@
<languageMapping language="JAVA"
serverId="microprofile"
documentMatcher="com.redhat.devtools.intellij.quarkus.lsp.QuarkusDocumentMatcherForJavaFile"/>
<serverIconProvider serverId="microprofile" class="com.redhat.devtools.intellij.microprofile.lang.MicroProfileServerIconProvider" />
</extensions>

<extensions defaultExtensionNs="com.intellij">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/lsp4ij-qute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- Qute LSP -->
<server id="qute"
label="Qute support"
icon="com.redhat.devtools.intellij.quarkus.lang.QuarkusIcons.Quarkus"
class="com.redhat.devtools.intellij.qute.lsp.QuteServer"
clientImpl="com.redhat.devtools.intellij.qute.lsp.QuteLanguageClient"
serverInterface="com.redhat.qute.ls.api.QuteLanguageServerAPI"
Expand Down Expand Up @@ -32,7 +33,6 @@
<languageMapping language="JAVA"
serverId="qute"
documentMatcher="com.redhat.devtools.intellij.qute.lsp.QuteDocumentMatcherForJavaFile"/>
<serverIconProvider serverId="qute" class="com.redhat.devtools.intellij.quarkus.lang.QuarkusServerIconProvider" />
</extensions>

<extensions defaultExtensionNs="com.intellij">
Expand Down

0 comments on commit 138c28b

Please sign in to comment.