Skip to content

Commit c12e20f

Browse files
committed
Feat && Publish: added automatic file type registration for '.jsonld' extensions to JSON language. Publish version 0.0.2 with support for 213.* versions
1 parent 8764880 commit c12e20f

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
pluginGroup = com.github.tomsfernandez.jsonld
55
pluginName = JSON-LD
6-
pluginVersion = 0.0.1
6+
pluginVersion = 0.0.2
77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.
1010
pluginSinceBuild = 203
11-
pluginUntilBuild = 212.*
11+
pluginUntilBuild = 213.*
1212

1313
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
1414
# See https://jb.gg/intellij-platform-builds-list for available build versions.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.github.tomsfernandez.jsonld.lang
2+
3+
import com.intellij.icons.AllIcons
4+
import com.intellij.json.JsonLanguage
5+
import com.intellij.openapi.fileTypes.LanguageFileType
6+
import javax.swing.Icon
7+
8+
class JsonLdFileType : LanguageFileType(JsonLanguage.INSTANCE) {
9+
10+
companion object {
11+
val INSTANCE = JsonLdFileType()
12+
val DEFAULT_EXTENSION = "jsonld"
13+
}
14+
15+
override fun getName(): String {
16+
return "JSON-LD"
17+
}
18+
19+
override fun getDescription(): String {
20+
return "JSON-LD"
21+
}
22+
23+
override fun getDefaultExtension(): String {
24+
return DEFAULT_EXTENSION
25+
}
26+
27+
override fun getIcon(): Icon {
28+
return AllIcons.FileTypes.Json
29+
}
30+
}

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<extensions defaultExtensionNs="com.intellij">
1616
<lang.directNavigationProvider implementation="com.github.tomsfernandez.jsonld.experimental.JsonLinkDirectNavigation"/>
17+
<fileType name="JSON-LD" implementationClass="com.github.tomsfernandez.jsonld.lang.JsonLdFileType" language="JSON" extensions="jsonld"/>
1718
<!-- <annotator language="JSON" implementationClass="com.github.tomsfernandez.jsonld.extensions.LinkTargetNotFoundAnnotator"/>-->
1819
<projectService serviceImplementation="com.github.tomsfernandez.jsonld.services.JsonLdElementIndexService" />
1920
</extensions>

0 commit comments

Comments
 (0)