From 5edaf47f280c5756bffb68105ba31c2df4adfd58 Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Mon, 19 Jul 2021 15:56:08 +0200 Subject: [PATCH] =?UTF-8?q?Renamed=20Language=20from=20M68k=20to=20MC68000?= =?UTF-8?q?=20to=20allow=20coexistence=20with=20Yann=20C=C3=A9bron's=20M68?= =?UTF-8?q?k-Plugin=20(unreleased).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/m68k/M68kFileElementType.java | 2 +- .../intellij/plugins/m68k/M68kFileType.kt | 4 +- .../intellij/plugins/m68k/M68kLanguage.kt | 9 ---- .../intellij/plugins/m68k/MC68000Language.kt | 9 ++++ .../plugins/m68k/psi/M68kElementType.kt | 2 +- .../intellij/plugins/m68k/psi/M68kFile.kt | 4 +- .../plugins/m68k/psi/M68kTokenType.kt | 2 +- .../m68k/syntax/M68kSyntaxHighlighter.kt | 42 +++++++++---------- src/main/resources/META-INF/plugin.xml | 16 +++---- 9 files changed, 45 insertions(+), 45 deletions(-) delete mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/M68kLanguage.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/MC68000Language.kt diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.java b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.java index 154543d..36ff2ed 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.java +++ b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.java @@ -14,7 +14,7 @@ public class M68kFileElementType extends IStubFileElementType { public static final int VERSION = 1; private M68kFileElementType() { - super("M68K_FILE", M68kLanguage.Companion.getINSTANCE()); + super("MC68000_FILE", MC68000Language.Companion.getINSTANCE()); } @Override diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileType.kt b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileType.kt index 51ed048..fc614f7 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileType.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileType.kt @@ -6,10 +6,10 @@ import org.jetbrains.annotations.NonNls import javax.swing.Icon @Suppress("unused") -class M68kFileType private constructor() : LanguageFileType(M68kLanguage.INSTANCE, false) { +class M68kFileType private constructor() : LanguageFileType(MC68000Language.INSTANCE, false) { @NonNls override fun getName(): String { - return "M68k Assembler" + return "MC68000 Assembler" } override fun getDescription(): String { diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/M68kLanguage.kt b/src/main/java/de/platon42/intellij/plugins/m68k/M68kLanguage.kt deleted file mode 100644 index b28dde1..0000000 --- a/src/main/java/de/platon42/intellij/plugins/m68k/M68kLanguage.kt +++ /dev/null @@ -1,9 +0,0 @@ -package de.platon42.intellij.plugins.m68k - -import com.intellij.lang.Language - -class M68kLanguage private constructor() : Language("M68k") { - companion object { - val INSTANCE = M68kLanguage() - } -} \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/MC68000Language.kt b/src/main/java/de/platon42/intellij/plugins/m68k/MC68000Language.kt new file mode 100644 index 0000000..4bcd03a --- /dev/null +++ b/src/main/java/de/platon42/intellij/plugins/m68k/MC68000Language.kt @@ -0,0 +1,9 @@ +package de.platon42.intellij.plugins.m68k + +import com.intellij.lang.Language + +class MC68000Language private constructor() : Language("MC68000") { + companion object { + val INSTANCE = MC68000Language() + } +} \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kElementType.kt b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kElementType.kt index 09a27f9..ec4001b 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kElementType.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kElementType.kt @@ -1,6 +1,6 @@ package de.platon42.intellij.plugins.m68k.psi import com.intellij.psi.tree.IElementType -import de.platon42.intellij.plugins.m68k.M68kLanguage.Companion.INSTANCE +import de.platon42.intellij.plugins.m68k.MC68000Language.Companion.INSTANCE class M68kElementType(debugName: String) : IElementType(debugName, INSTANCE) \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kFile.kt b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kFile.kt index 7ae3d3c..11a0960 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kFile.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kFile.kt @@ -3,9 +3,9 @@ package de.platon42.intellij.plugins.m68k.psi import com.intellij.extapi.psi.PsiFileBase import com.intellij.psi.FileViewProvider import de.platon42.intellij.plugins.m68k.M68kFileType -import de.platon42.intellij.plugins.m68k.M68kLanguage +import de.platon42.intellij.plugins.m68k.MC68000Language -class M68kFile(private val fileViewProvider: FileViewProvider) : PsiFileBase(fileViewProvider, M68kLanguage.INSTANCE) { +class M68kFile(private val fileViewProvider: FileViewProvider) : PsiFileBase(fileViewProvider, MC68000Language.INSTANCE) { override fun toString(): String { val virtualFile = if (fileViewProvider.isEventSystemEnabled) fileViewProvider.virtualFile else null return "Assembly File: " + (virtualFile?.name ?: "") diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kTokenType.kt b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kTokenType.kt index 8dea5fc..37ad8cc 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kTokenType.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kTokenType.kt @@ -1,7 +1,7 @@ package de.platon42.intellij.plugins.m68k.psi import com.intellij.psi.tree.IElementType -import de.platon42.intellij.plugins.m68k.M68kLanguage.Companion.INSTANCE +import de.platon42.intellij.plugins.m68k.MC68000Language.Companion.INSTANCE import org.jetbrains.annotations.NonNls class M68kTokenType(@NonNls debugName: String) : IElementType(debugName, INSTANCE) { diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt index c03d14e..00f789b 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt @@ -50,26 +50,26 @@ class M68kSyntaxHighlighter(val project: Project?) : SyntaxHighlighterBase() { } companion object { - val GLOBAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_LOCAL_LABEL", DefaultLanguageHighlighterColors.LOCAL_VARIABLE) - val LOCAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_GLOBAL_LABEL", DefaultLanguageHighlighterColors.GLOBAL_VARIABLE) - val SEPARATOR = TextAttributesKey.createTextAttributesKey("M68K_SEPARATOR", DefaultLanguageHighlighterColors.COMMA) - val COLON = TextAttributesKey.createTextAttributesKey("M68K_COLON", DefaultLanguageHighlighterColors.DOT) - val SYMBOLDEF = TextAttributesKey.createTextAttributesKey("M68K_SYMBOLDEF", DefaultLanguageHighlighterColors.STATIC_FIELD) - val SYMBOLREF = TextAttributesKey.createTextAttributesKey("M68K_SYMBOLREF", DefaultLanguageHighlighterColors.IDENTIFIER) - val PROGRAM_COUNTER = TextAttributesKey.createTextAttributesKey("M68K_PROGRAM_COUNTER", DefaultLanguageHighlighterColors.IDENTIFIER) - val MNEMONIC = TextAttributesKey.createTextAttributesKey("M68K_MNEMONIC", DefaultLanguageHighlighterColors.FUNCTION_CALL) - val MACRO_CALL = TextAttributesKey.createTextAttributesKey("M68K_MACRO_CALL", DefaultLanguageHighlighterColors.STATIC_METHOD) - val DATA_WIDTH_BS = TextAttributesKey.createTextAttributesKey("M68K_DATA_WIDTH_BS", DefaultLanguageHighlighterColors.DOT) - val DATA_WIDTH_L = TextAttributesKey.createTextAttributesKey("M68K_DATA_WIDTH_W", DefaultLanguageHighlighterColors.DOT) - val DATA_WIDTH_W = TextAttributesKey.createTextAttributesKey("M68K_DATA_WIDTH_L", DefaultLanguageHighlighterColors.DOT) - val DATA_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("M68K_DATA_PREPROCESSOR", DefaultLanguageHighlighterColors.CONSTANT) - val OTHER_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("M68K_OTHER_PREPROCESSOR", DefaultLanguageHighlighterColors.KEYWORD) - val STRING = TextAttributesKey.createTextAttributesKey("M68K_STRING", DefaultLanguageHighlighterColors.STRING) - val NUMBER = TextAttributesKey.createTextAttributesKey("M68K_NUMBER", DefaultLanguageHighlighterColors.NUMBER) - val AREG = TextAttributesKey.createTextAttributesKey("M68K_AREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) - val DREG = TextAttributesKey.createTextAttributesKey("M68K_DREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) - val SPECIAL_REG = TextAttributesKey.createTextAttributesKey("M68K_SPECIALREG", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) - val COMMENT = TextAttributesKey.createTextAttributesKey("M68K_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT) - val BAD_CHARACTER = TextAttributesKey.createTextAttributesKey("M68K_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER) + val GLOBAL_LABEL = TextAttributesKey.createTextAttributesKey("MC68000_LOCAL_LABEL", DefaultLanguageHighlighterColors.LABEL) + val LOCAL_LABEL = TextAttributesKey.createTextAttributesKey("MC68000_GLOBAL_LABEL", DefaultLanguageHighlighterColors.FUNCTION_DECLARATION) + val SEPARATOR = TextAttributesKey.createTextAttributesKey("MC68000_SEPARATOR", DefaultLanguageHighlighterColors.COMMA) + val COLON = TextAttributesKey.createTextAttributesKey("MC68000_COLON", DefaultLanguageHighlighterColors.DOT) + val SYMBOLDEF = TextAttributesKey.createTextAttributesKey("MC68000_SYMBOLDEF", DefaultLanguageHighlighterColors.CONSTANT) + val SYMBOLREF = TextAttributesKey.createTextAttributesKey("MC68000_SYMBOLREF", DefaultLanguageHighlighterColors.IDENTIFIER) + val MNEMONIC = TextAttributesKey.createTextAttributesKey("MC68000_MNEMONIC", DefaultLanguageHighlighterColors.FUNCTION_CALL) + val MACRO_CALL = TextAttributesKey.createTextAttributesKey("MC68000_MACRO_CALL", DefaultLanguageHighlighterColors.STATIC_METHOD) + val DATA_WIDTH_BS = TextAttributesKey.createTextAttributesKey("MC68000_DATA_WIDTH_BS", DefaultLanguageHighlighterColors.DOT) + val DATA_WIDTH_L = TextAttributesKey.createTextAttributesKey("MC68000_DATA_WIDTH_W", DefaultLanguageHighlighterColors.DOT) + val DATA_WIDTH_W = TextAttributesKey.createTextAttributesKey("MC68000_DATA_WIDTH_L", DefaultLanguageHighlighterColors.DOT) + val DATA_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("MC68000_DATA_PREPROCESSOR", DefaultLanguageHighlighterColors.STATIC_FIELD) + val OTHER_PREPROCESSOR = TextAttributesKey.createTextAttributesKey("MC68000_OTHER_PREPROCESSOR", DefaultLanguageHighlighterColors.KEYWORD) + val STRING = TextAttributesKey.createTextAttributesKey("MC68000_STRING", DefaultLanguageHighlighterColors.STRING) + val NUMBER = TextAttributesKey.createTextAttributesKey("MC68000_NUMBER", DefaultLanguageHighlighterColors.NUMBER) + val AREG = TextAttributesKey.createTextAttributesKey("MC68000_AREG", DefaultLanguageHighlighterColors.PARAMETER) + val DREG = TextAttributesKey.createTextAttributesKey("MC68000_DREG", DefaultLanguageHighlighterColors.PARAMETER) + val SPECIAL_REG = TextAttributesKey.createTextAttributesKey("MC68000_SPECIALREG", DefaultLanguageHighlighterColors.PARAMETER) + val PROGRAM_COUNTER = TextAttributesKey.createTextAttributesKey("MC68000_PROGRAM_COUNTER", DefaultLanguageHighlighterColors.PARAMETER) + val COMMENT = TextAttributesKey.createTextAttributesKey("MC68000_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT) + val BAD_CHARACTER = TextAttributesKey.createTextAttributesKey("MC68000_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER) } } \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 26c8df2..ef4ccbc 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -14,17 +14,17 @@ com.intellij.modules.lang - - + - - - - - + + + +