generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(language): add Shire language support
Add Shire language support with language definition, file type, icons, and plugin configuration.
- Loading branch information
Showing
7 changed files
with
94 additions
and
31 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
language/src/main/kotlin/com/phodal/shirelang/ShireFileType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.phodal.shirelang | ||
|
||
import com.intellij.openapi.fileTypes.FileType | ||
import com.intellij.openapi.fileTypes.LanguageFileType | ||
import com.intellij.openapi.vfs.VirtualFile | ||
import javax.swing.Icon | ||
|
||
class ShireFileType : LanguageFileType(ShireLanguage) { | ||
override fun getName(): String = "DevInFile" | ||
|
||
override fun getIcon(): Icon = ShireIcons.DEFAULT | ||
|
||
override fun getDefaultExtension(): String = "shire" | ||
|
||
override fun getCharset(file: VirtualFile, content: ByteArray): String = "UTF-8" | ||
|
||
override fun getDescription(): String = "Shire file" | ||
|
||
companion object { | ||
val INSTANCE: FileType = ShireFileType() | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
language/src/main/kotlin/com/phodal/shirelang/ShireIcons.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.phodal.shirelang | ||
|
||
import com.intellij.openapi.util.IconLoader | ||
import javax.swing.Icon | ||
|
||
object ShireIcons { | ||
@JvmField | ||
val DEFAULT: Icon = IconLoader.getIcon("/icons/shire.svg", ShireIcons::class.java) | ||
@JvmField | ||
val COMMAND: Icon = IconLoader.getIcon("/icons/shire.svg", ShireIcons::class.java) | ||
@JvmField | ||
val Terminal: Icon = IconLoader.getIcon("/icons/terminal.svg", ShireIcons::class.java) | ||
} |
9 changes: 9 additions & 0 deletions
9
language/src/main/kotlin/com/phodal/shirelang/ShireLanguage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.phodal.shirelang | ||
|
||
import com.intellij.lang.Language | ||
|
||
object ShireLanguage : Language("Shire", "text/shire", "text/x-shire", "application/x-shire") { | ||
val INSTANCE: Language = ShireLanguage | ||
override fun isCaseSensitive() = true | ||
override fun getDisplayName() = "Shire" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,46 @@ | ||
<idea-plugin package="com.phodal.shire"> | ||
<idea-plugin package="com.phodal.shirelang"> | ||
<dependencies> | ||
<plugin id="org.intellij.plugins.markdown"/> | ||
<plugin id="com.jetbrains.sh"/> | ||
</dependencies> | ||
|
||
<!-- <extensions defaultExtensionNs="com.intellij">--> | ||
<!-- <!– refs: https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/simple_language_plugin/src/main/resources/META-INF/plugin.xml–>--> | ||
<!-- <fileType name="ShireFile" implementationClass="com.phodal.shire.language.ShireFileType" fieldName="INSTANCE"--> | ||
<!-- language="Shire" extensions="Shire"/>--> | ||
<extensions defaultExtensionNs="com.intellij"> | ||
<!-- refs: https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/simple_language_plugin/src/main/resources/META-INF/plugin.xml--> | ||
<fileType name="ShireFile" implementationClass="com.phodal.shirelang.ShireFileType" fieldName="INSTANCE" | ||
language="Shire" extensions="shire"/> | ||
|
||
<!-- <lang.parserDefinition language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.parser.ShireParserDefinition"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.parser.ShireParserDefinition"/>--> | ||
<!-- <lang.syntaxHighlighterFactory language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.highlight.ShireSyntaxHighlighterFactory"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.highlight.ShireSyntaxHighlighterFactory"/>--> | ||
|
||
<!-- <lang.ast.factory language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.ShireAstFactory"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.ShireAstFactory"/>--> | ||
|
||
<!-- <typedHandler implementation="com.phodal.shire.language.ShireTypedHandler"/>--> | ||
<!-- <typedHandler implementation="com.phodal.shirelang.ShireTypedHandler"/>--> | ||
|
||
<!-- <completion.contributor language="Shire"--> | ||
<!-- id="ShireCompletionContributor"--> | ||
<!-- order="first"--> | ||
<!-- implementationClass="com.phodal.shire.language.completion.ShireCompletionContributor"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.completion.ShireCompletionContributor"/>--> | ||
<!-- <completion.contributor language="Shire"--> | ||
<!-- order="after ShireCompletionContributor"--> | ||
<!-- implementationClass="com.phodal.shire.language.completion.UserCustomCompletionContributor"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.completion.UserCustomCompletionContributor"/>--> | ||
|
||
<!-- <lang.foldingBuilder language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.folding.ShireCustomVariableFoldingBuilder"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.folding.ShireCustomVariableFoldingBuilder"/>--> | ||
<!-- <lang.foldingBuilder language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.folding.ShireFileReferenceFoldingBuilder"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.folding.ShireFileReferenceFoldingBuilder"/>--> | ||
|
||
<!-- <languageInjector implementation="com.phodal.shire.language.ShireLanguageInjector"/>--> | ||
<!-- <languageInjector implementation="com.phodal.shirelang.ShireLanguageInjector"/>--> | ||
|
||
|
||
<!-- <configurationType implementation="com.phodal.shire.language.run.ShiresConfigurationType"/>--> | ||
<!-- <programRunner implementation="com.phodal.shire.language.run.ShiresProgramRunner"/>--> | ||
<!-- <runConfigurationBeforeRunProviderDelegate implementation="com.phodal.shire.language.run.ShiresBeforeRunProviderDelegate"/>--> | ||
<!-- <runConfigurationProducer implementation="com.phodal.shire.language.run.ShiresRunConfigurationProducer"/>--> | ||
<!-- <configurationType implementation="com.phodal.shirelang.run.ShiresConfigurationType"/>--> | ||
<!-- <programRunner implementation="com.phodal.shirelang.run.ShiresProgramRunner"/>--> | ||
<!-- <runConfigurationBeforeRunProviderDelegate implementation="com.phodal.shirelang.run.ShiresBeforeRunProviderDelegate"/>--> | ||
<!-- <runConfigurationProducer implementation="com.phodal.shirelang.run.ShiresRunConfigurationProducer"/>--> | ||
<!-- <runLineMarkerContributor language="Shire"--> | ||
<!-- implementationClass="com.phodal.shire.language.run.ShiresRunLineMarkersProvider"/>--> | ||
<!-- implementationClass="com.phodal.shirelang.run.ShiresRunLineMarkersProvider"/>--> | ||
|
||
<!-- <lang.commenter language="Shire" implementationClass="com.phodal.shire.language.commenter.ShiresCommenter"/>--> | ||
|
||
<!-- <lang.documentationProvider language="Shire"--> | ||
<!-- id="ShiresDocumentationProvider"--> | ||
<!-- implementationClass="com.phodal.shire.language.documentation.ShiresDocumentationProvider"/>--> | ||
|
||
<!-- <localInspection language="Shire" groupPath="Shire" groupName="Lints"--> | ||
<!-- displayName="Duplicate agent declaration"--> | ||
<!-- enabledByDefault="true"--> | ||
<!-- level="ERROR"--> | ||
<!-- implementationClass="com.phodal.shire.language.lints.ShiresDuplicateAgentInspection"/>--> | ||
<!-- </extensions>--> | ||
</extensions> | ||
</idea-plugin> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.