Skip to content

Commit

Permalink
Fix missing external id in stub class
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixafy committed Apr 21, 2024
1 parent 6ab973e commit 15753a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## v1.0.2
- Fix "Cannot distinguish StubFileElementTypes" error (performance issue)

## v1.0.1
- Add null-safe operator support
- Automatically attach plugin .jars to latest release
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pluginGroup = org.nette.latte
pluginName = Latte Support
# SemVer format -> https://semver.org
pluginVersion = 1.0.1
pluginVersion = 1.0.2

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 221
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/nette/latte/parser/LatteElementTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.ILightStubFileElementType;
import com.intellij.util.diff.FlyweightCapableTreeStructure;
import org.jetbrains.annotations.NotNull;
import org.nette.latte.LatteLanguage;
import org.nette.latte.indexes.stubs.LatteFileStub;

public class LatteElementTypes {
public static LatteLanguage LANG = LatteLanguage.INSTANCE;

public static final ILightStubFileElementType<LatteFileStub> FILE = new ILightStubFileElementType<LatteFileStub>(LANG) {
public static final ILightStubFileElementType<LatteFileStub> FILE = new ILightStubFileElementType<>(LANG) {
@NotNull
@Override
public String getExternalId() {
return "latte." + super.getExternalId();
}

@Override
public FlyweightCapableTreeStructure<LighterASTNode> parseContentsLight(ASTNode chameleon) {
PsiElement psi = chameleon.getPsi();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

<!-- must have -->
<completion.contributor language="Latte" implementationClass="org.nette.latte.completion.LatteCompletionContributor"/>
<renamePsiElementProcessor implementation="refactoring.org.nette.latte.LatteRenamePsiElementProcessor"/>
<renamePsiElementProcessor implementation="org.nette.latte.refactoring.LatteRenamePsiElementProcessor"/>
<lang.smartEnterProcessor implementationClass="org.nette.latte.editor.LatteSmartEnterProcessor" />

<!-- needed? -->
<referencesSearch implementation="org.nette.latte.reference.LatteReferenceSearch"/>

<stubElementTypeHolder class="org.nette.latte.psi.LatteTypes"/>
<stubElementTypeHolder class="org.nette.latte.psi.LatteTypes" externalIdPrefix="latte."/>
<stubIndex implementation="org.nette.latte.indexes.extensions.LatteFilterIndex"/>
<stubIndex implementation="org.nette.latte.indexes.extensions.LattePhpClassIndex"/>
<stubIndex implementation="org.nette.latte.indexes.extensions.LattePhpConstantIndex"/>
Expand Down

0 comments on commit 15753a2

Please sign in to comment.