Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Declare server icon with icon attribute #1288

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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

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;
fbricon marked this conversation as resolved.
Show resolved Hide resolved

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
Loading