Renamed Language from M68k to MC68000 to allow coexistence with Yann Cébron's M68k-Plugin (unreleased).

This commit is contained in:
Chris Hodges 2021-07-19 15:56:08 +02:00
parent b966623765
commit 5edaf47f28
9 changed files with 45 additions and 45 deletions

View File

@ -14,7 +14,7 @@ public class M68kFileElementType extends IStubFileElementType<M68kFileStub> {
public static final int VERSION = 1;
private M68kFileElementType() {
super("M68K_FILE", M68kLanguage.Companion.getINSTANCE());
super("MC68000_FILE", MC68000Language.Companion.getINSTANCE());
}
@Override

View File

@ -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 {

View File

@ -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()
}
}

View File

@ -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()
}
}

View File

@ -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)

View File

@ -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 ?: "<unknown>")

View File

@ -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) {

View File

@ -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)
}
}

View File

@ -14,17 +14,17 @@
<depends>com.intellij.modules.lang</depends>
<extensions defaultExtensionNs="com.intellij">
<fileType name="M68k Assembler" implementationClass="de.platon42.intellij.plugins.m68k.M68kFileType"
fieldName="INSTANCE" language="M68k" extensions="asm;ASM;s;S;i"/>
<lang.parserDefinition language="M68k"
<fileType name="MC68000 Assembler" implementationClass="de.platon42.intellij.plugins.m68k.M68kFileType"
fieldName="INSTANCE" language="MC68000" extensions="asm;ASM;s;S;i"/>
<lang.parserDefinition language="MC68000"
implementationClass="de.platon42.intellij.plugins.m68k.parser.M68kParserDefinition"/>
<lang.syntaxHighlighterFactory language="M68k"
<lang.syntaxHighlighterFactory language="MC68000"
implementationClass="de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighterFactory"/>
<colorSettingsPage implementation="de.platon42.intellij.plugins.m68k.syntax.M68kColorSettingsPage"/>
<completion.contributor language="M68k" implementationClass="de.platon42.intellij.plugins.m68k.asm.M68kMnemonicCompletionContributor"/>
<lang.braceMatcher language="M68k" implementationClass="de.platon42.intellij.plugins.m68k.syntax.M68kPairedBraceMatcher"/>
<lang.quoteHandler language="M68k" implementationClass="de.platon42.intellij.plugins.m68k.M68kStringQuoteHandler"/>
<lang.findUsagesProvider language="M68k" implementationClass="de.platon42.intellij.plugins.m68k.scanner.M68kFindUsagesProvider"/>
<completion.contributor language="MC68000" implementationClass="de.platon42.intellij.plugins.m68k.asm.M68kMnemonicCompletionContributor"/>
<lang.braceMatcher language="MC68000" implementationClass="de.platon42.intellij.plugins.m68k.syntax.M68kPairedBraceMatcher"/>
<lang.quoteHandler language="MC68000" implementationClass="de.platon42.intellij.plugins.m68k.M68kStringQuoteHandler"/>
<lang.findUsagesProvider language="MC68000" implementationClass="de.platon42.intellij.plugins.m68k.scanner.M68kFindUsagesProvider"/>
<lang.elementManipulator forClass="de.platon42.intellij.plugins.m68k.psi.M68kSymbolReference"
implementationClass="de.platon42.intellij.plugins.m68k.refs.M68kSymbolReferenceElementManipulator"/>