From 25450a9bf86aaed18f5467ca95eb90fdff4097d4 Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Tue, 27 Jul 2021 16:34:49 +0200 Subject: [PATCH] Macro definitions are now word and indexed, macro calls reference to definition. Macro definition refactoring and find usages support. Structural View also shows macro definitions. Missing REPT and ENDR assembler directives added. Changed or added some icons at various places. Reference search for global labels and symbols now uses stub index. --- README.md | 6 ++ build.gradle | 6 ++ .../plugins/m68k/lexer/_M68kLexer.java | 8 +-- .../plugins/m68k/parser/M68kParser.java | 38 ++++++++---- .../plugins/m68k/psi/M68kMacroCall.java | 13 +++++ .../plugins/m68k/psi/M68kMacroDefinition.java | 15 ++++- .../intellij/plugins/m68k/psi/M68kTypes.java | 4 +- .../plugins/m68k/psi/M68kVisitor.java | 2 +- .../m68k/psi/impl/M68kMacroCallImpl.java | 27 +++++++-- .../psi/impl/M68kMacroDefinitionImpl.java | 34 +++++++++-- .../plugins/m68k/M68kFileElementType.kt | 2 +- .../intellij/plugins/m68k/M68kIcons.kt | 3 +- .../plugins/m68k/asm/AssemblerDirectives.kt | 58 ++++++++++--------- .../asm/M68kMnemonicCompletionContributor.kt | 11 +++- .../intellij/plugins/m68k/lexer/LexerUtil.kt | 12 ++++ .../plugins/m68k/lexer/_M68kLexer.flex | 12 ++-- .../platon42/intellij/plugins/m68k/m68k.bnf | 19 +++++- .../plugins/m68k/psi/M68kElementFactory.kt | 10 ++++ .../plugins/m68k/psi/M68kLookupUtil.kt | 44 ++++++++++++++ .../plugins/m68k/psi/M68kMacroCallMixin.kt | 13 +++++ .../m68k/psi/M68kMacroDefinitionMixin.kt | 29 ++++++++++ .../plugins/m68k/psi/M68kPsiImplUtil.kt | 23 ++++++++ .../m68k/psi/M68kRenameInputValidator.kt | 5 +- .../refs/M68kGlobalLabelSymbolReference.kt | 31 ++++++---- .../M68kMacroCallCompletionContributor.kt | 19 ++++++ .../refs/M68kMacroCallElementManipulator.kt | 17 ++++++ .../plugins/m68k/refs/M68kMacroReference.kt | 49 ++++++++++++++++ .../m68k/refs/M68kReferenceContributor.kt | 8 +++ .../m68k/scanner/M68kFindUsagesProvider.kt | 6 +- .../structureview/M68kStructureViewElement.kt | 1 + .../structureview/M68kStructureViewModel.kt | 3 +- .../plugins/m68k/stubs/M68kElementTypes.kt | 26 +++++++++ .../m68k/stubs/M68kMacroDefinitionStub.kt | 6 ++ .../stubs/M68kMacroDefinitionStubIndex.kt | 16 +++++ .../m68k/stubs/M68kStubElementTypeFactory.kt | 1 + .../stubs/impl/M68kMacroDefinitionStubImpl.kt | 13 +++++ .../m68k/syntax/M68kSyntaxHighlighter.kt | 2 +- src/main/resources/META-INF/plugin.xml | 4 ++ .../plugins/m68k/parser/MacroCallTest.kt | 5 ++ .../M68kMacroCallCompletionContributorTest.kt | 32 ++++++++++ .../m68k/refs/M68kReferenceContributorTest.kt | 23 ++++++-- .../structureview/M68kStructureViewTest.kt | 2 + ...l_with_space_introduces_comment_option.txt | 8 ++- ...ithout_space_introduces_comment_option.txt | 8 ++- ...indented_dot_local_label_without_label.txt | 2 +- ...ented_local_label_dollar_without_label.txt | 5 +- .../macros/call_with_complex_parameters.txt | 8 ++- .../parser/macros/call_with_label.txt | 13 +++++ .../macros/pushm_call_with_register_list.txt | 5 +- ...ll_with_specially_bracketed_parameters.txt | 20 ++++--- .../standard_macrocall_without_parameters.txt | 2 +- .../resources/references/macros/macros.asm | 13 +++++ .../references/macros/macros_after_rename.asm | 13 +++++ .../resources/structureview/basic_example.asm | 8 +++ 54 files changed, 649 insertions(+), 114 deletions(-) create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kMacroCallMixin.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kMacroDefinitionMixin.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kMacroCallCompletionContributor.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kMacroCallElementManipulator.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kMacroReference.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/stubs/M68kMacroDefinitionStub.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/stubs/M68kMacroDefinitionStubIndex.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/stubs/impl/M68kMacroDefinitionStubImpl.kt create mode 100644 src/test/java/de/platon42/intellij/plugins/m68k/refs/M68kMacroCallCompletionContributorTest.kt create mode 100644 src/test/resources/parser/macros/call_with_label.txt create mode 100644 src/test/resources/references/macros/macros.asm create mode 100644 src/test/resources/references/macros/macros_after_rename.asm diff --git a/README.md b/README.md index f3741c0..7c2859f 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42. ### V0.3 (unreleased) - Enhancement: Macros contents are no longer parsed, added syntax highlighting options for macros. +- Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition. +- Enhancement: Macro definition refactoring and find usages support. +- Enhancement: Structural View also shows macro definitions. +- Bugfix: Missing REPT and ENDR assembler directives added. +- Cosmetics: Changed or added some icons at various places. +- Performance: Reference search for global labels and symbols now uses stub index. ### V0.2 (27-Jul-21) diff --git a/build.gradle b/build.gradle index 565b743..a56db23 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,12 @@ patchPluginXml {

V0.3 (unreleased)

V0.2 (27-Jul-21)