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

Add .cypher icon, file template and type #189

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from 1 commit
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
Next Next commit
Add .cypher icon, file template and type
jamthief committed Mar 21, 2024
commit 69dbafaf2b37865b1f4d3c891d4ad1bf29c6672d
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.neo4j.intellij.lsp.language;

import com.intellij.openapi.fileTypes.LanguageFileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public final class CypherFileType extends LanguageFileType {

public static final CypherFileType INSTANCE = new CypherFileType();

private CypherFileType() {
super(CypherLanguage.INSTANCE);
}

@NotNull
@Override
public String getName() {
return "Cypher File";
}

@NotNull
@Override
public String getDescription() {
return "Cypher language file";
}

@NotNull
@Override
public String getDefaultExtension() {
return "cypher";
}

@Nullable
@Override
public Icon getIcon() {
return CypherIcons.FILE;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.neo4j.intellij.lsp.language;

import com.intellij.openapi.util.IconLoader;

import javax.swing.*;

public class CypherIcons {
/* File icon - 16x16 pixels - displayed next to the file name on the file tab */
public static final Icon FILE = IconLoader.getIcon("META-INF/fileIcon.svg", CypherIcons.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.neo4j.intellij.lsp.language;

import com.intellij.lang.Language;

public class CypherLanguage extends Language {

public static final CypherLanguage INSTANCE = new CypherLanguage();
private CypherLanguage() {
super("Cypher");
}
}
10 changes: 10 additions & 0 deletions editor-plugin/intellij/src/main/resources/META-INF/fileIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions editor-plugin/intellij/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -17,5 +17,11 @@
<extensions defaultExtensionNs="com.intellij">
<platform.lsp.serverSupportProvider
implementation="org.neo4j.intellij.lsp.cypherlspsupport.CypherLspServerSupportProvider"/>
<fileType
name="Cypher File"
implementationClass="org.neo4j.intellij.lsp.language.CypherFileType"
fieldName="INSTANCE"
language="Cypher"
extensions="cypher"/>
</extensions>
</idea-plugin>
Empty file.