Skip to content

Commit a376cf3

Browse files
committed
Implemented an additional RenameProcessor to find all elements to rename correctly.
Workaround to bug https://youtrack.jetbrains.com/issue/IDEA-165760
1 parent 487b38a commit a376cf3

9 files changed

Lines changed: 68 additions & 310 deletions

File tree

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/META-INF/plugin.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<id>de.halirutan.mathematica</id>
33
<name>Mathematica Support</name>
44
<category>Custom Language</category>
5-
<version>2.0.11</version>
5+
<version>2.0.12</version>
66
<idea-version since-build="163.7743.44"/>
77
<vendor email="patrick@halirutan.de" url="http://mathematicaplugin.halirutan.de">Patrick Scheibe</vendor>
88
<depends>com.intellij.modules.lang</depends>
@@ -166,11 +166,7 @@
166166
implementation="de.halirutan.mathematica.codeinsight.inspections.MathematicaInspectionProvider"/>
167167

168168
<psi.referenceContributor language="Mathematica" implementation="de.halirutan.mathematica.parsing.psi.MathematicaReferenceContributor"/>
169-
170-
<lang.findUsagesProvider language="Mathematica"
171-
implementationClass="de.halirutan.mathematica.find.MathematicaFindUsageProvider"/>
172-
173-
169+
<renamePsiElementProcessor implementation="de.halirutan.mathematica.refactoring.MathematicaPsiRenameProcessor"/>
174170

175171
<!--<applicationService serviceInterface="de.halirutan.mathematica.MathematicaSettings" serviceImplementation="de.halirutan.mathematica.MathematicaSettings"/>-->
176172
<!--<applicationConfigurable groupId="language" displayName="Mathematica" id="preferences.Mathematica"-->
@@ -210,8 +206,8 @@
210206
description="Collapse all named characters into their utf8 counterpart.">
211207
</action>
212208

213-
<action id="Mathematica.RenameReferenenceResolve" class="de.halirutan.mathematica.actions.RenameReferenceResolve"
214-
text="Rename Referenence Resolve"/>
209+
<!--<action id="Mathematica.RenameReferenceResolve" class="de.halirutan.mathematica.actions.RenameReferenceResolve"-->
210+
<!--text="Rename Reference Resolve"/>-->
215211
<!--<separator/>-->
216212

217213
<!--<action id="Mathematica.ShowFormattingBlocks" class="de.halirutan.mathematica.actions.ShowFormattingBlocks"-->

src/de/halirutan/mathematica/codeinsight/findusage/MathematicaFindUsageHandler.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/de/halirutan/mathematica/codeinsight/findusage/MathematicaFindUsageHandlerFactory.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/de/halirutan/mathematica/codeinsight/findusage/MathematicaFindUsageProvider.java

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/de/halirutan/mathematica/find/MathematicaFindUsageProvider.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/de/halirutan/mathematica/parsing/psi/MathematicaReferenceContributor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class MathematicaReferenceContributor extends PsiReferenceContributor {
4141
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
4242
registrar.registerReferenceProvider(PlatformPatterns.psiElement(MString.class),
4343
new MathematicaStringReferenceProvider());
44-
// registrar.registerReferenceProvider(PlatformPatterns.psiElement(Symbol.class),
45-
// new MathematicaSymbolReferenceProvider());
44+
registrar.registerReferenceProvider(PlatformPatterns.psiElement(Symbol.class),
45+
new MathematicaSymbolReferenceProvider());
4646
}
4747
}

src/de/halirutan/mathematica/parsing/psi/impl/SymbolImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
3030
import de.halirutan.mathematica.filetypes.MathematicaFileType;
3131
import de.halirutan.mathematica.parsing.MathematicaElementTypes;
32-
import de.halirutan.mathematica.parsing.psi.MathematicaSymbolReferenceProvider;
3332
import de.halirutan.mathematica.parsing.psi.MathematicaVisitor;
3433
import de.halirutan.mathematica.parsing.psi.api.Symbol;
3534
import de.halirutan.mathematica.parsing.psi.util.LocalizationConstruct.ConstructType;
@@ -179,8 +178,7 @@ public void accept(@NotNull PsiElementVisitor visitor) {
179178
@NotNull
180179
@Override
181180
public PsiReference[] getReferences() {
182-
return super.getReferences();
183-
// return ReferenceProvidersRegistry.getReferencesFromProviders(this);
181+
return ReferenceProvidersRegistry.getReferencesFromProviders(this);
184182
}
185183

186184
}

0 commit comments

Comments
 (0)