From 5ffffb5680093a1eb1c81eb626682b904242ed28 Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Mon, 26 Jul 2021 19:52:48 +0200 Subject: [PATCH] Added M68kGlobalLabelSymbolCompletionContributor to replace variants returned by M68kGlobalLabelSymbolReference, to have more control over resolution. Contributor also adds registers to code completion. Code tidying. --- README.md | 3 +- build.gradle | 3 +- .../plugins/m68k/psi/M68kLookupUtil.kt | 4 + .../m68k/refs/M68kChooseByNameContributor.kt | 43 +++++++--- ...kGlobalLabelSymbolCompletionContributor.kt | 33 +++++++ .../refs/M68kGlobalLabelSymbolReference.kt | 33 ++----- .../m68k/scanner/M68kFindUsagesProvider.kt | 22 ++--- src/main/resources/META-INF/plugin.xml | 1 + ...balLabelSymbolCompletionContributorTest.kt | 86 +++++++++++++++++++ .../m68k/refs/M68kReferenceContributorTest.kt | 13 ++- .../completion/basic_completion.asm | 36 ++++++++ .../completion/basic_completion_after_op.asm | 36 ++++++++ .../{labels => symbols}/symbol_assignment.asm | 0 .../symbol_assignment_after_rename.asm | 0 14 files changed, 249 insertions(+), 64 deletions(-) create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributor.kt create mode 100644 src/test/java/de/platon42/intellij/plugins/m68k/refs/M68kGlobalLabelSymbolCompletionContributorTest.kt create mode 100644 src/test/resources/references/completion/basic_completion.asm create mode 100644 src/test/resources/references/completion/basic_completion_after_op.asm rename src/test/resources/references/{labels => symbols}/symbol_assignment.asm (100%) rename src/test/resources/references/{labels => symbols}/symbol_assignment_after_rename.asm (100%) diff --git a/README.md b/README.md index 9ea405f..38f2b28 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42. - Cosmetics: Added (same) icon for plugin as for file type. - Performance improvement: Use Word-Index for global labels and symbols instead of iterating over the file. - Performance improvement: Use Stub-Index for global labels and symbols. -- Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line +- Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line. +- Enhancement: Registers are now offered for code completion, making editing less annoying. ### V0.1 (20-Jul-21) diff --git a/build.gradle b/build.gradle index 675f821..9eb5a79 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,8 @@ patchPluginXml {
  • Cosmetics: Added (same) icon for plugin as for file type.
  • Performance improvement: Use Word-Index for global labels and symbols instead of iterating over the file.
  • Performance improvement: Use Stub-Index for global labels and symbols. -
  • Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line +
  • Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line. +
  • Enhancement: Registers are now offered for code completion, making editing less annoying.

    V0.1 (20-Jul-21)