Skip to content

Commit d26f77a

Browse files
hurricupmaxmedvedev
authored andcommitted
#403 Review fixes
1 parent 5254be3 commit d26f77a

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

resources/messages/attributeDescriptions/fallbackStubElementType.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>Allows specifying a fallback class to use for an elementType in the constructor of stub elements.</p>
44

55
<p>Usually the parser generator looks into the parent class file to detect which class to use.
6-
But in some cases a parent class file may not be available (not yet compiled).
6+
But in some cases the parent class file may not be available (not yet compiled).
77
In this case, it uses `IStubElementType` by default, which may not be the case in the modern code when `IElementType` should be used.
88
</p>
99

testData/generator/StubFallback.PSI.expected.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* Copyright 2011-2025 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
3-
*/
4-
51
// ---- FooTypes.java -----------------
62
//header.txt
73
package test;
@@ -242,15 +238,15 @@ public Element5 getElement5() {
242238
import com.intellij.psi.PsiElementVisitor;
243239
import test.psi.MyPsiTreeUtil;
244240
import static test.FooTypes.*;
245-
import com.intellij.extapi.psi.StubBasedPsiElementBase;
241+
import org.intellij.grammar.test.StubTest.GenericBase;
246242
import test.stub.Element2Stub;
247243
import test.psi.*;
248244
import com.intellij.psi.stubs.IStubElementType;
249245
import com.intellij.psi.tree.IElementType;
250246

251-
public class Element2Impl extends StubBasedPsiElementBase<Element2Stub> implements Element2 {
247+
public class Element2Impl extends GenericBase<Element2Stub> implements Element2 {
252248

253-
public Element2Impl(@NotNull Element2Stub stub, @NotNull IStubElementType<?, ?> type) {
249+
public Element2Impl(@NotNull Element2Stub stub, @NotNull IStubElementType type) {
254250
super(stub, type);
255251
}
256252

testData/generator/StubFallback.bnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
expressionUtilClass="test.FooUtil"
1818

1919
extends("element1|type")="org.intellij.grammar.test.StubTest.GenericBaseMissing<?>"
20+
extends("element2")="org.intellij.grammar.test.StubTest.GenericBase<?>"
2021
extends("simple")="org.intellij.grammar.test.StubTest.SimpleBase"
2122
extends("missing")="test.stub.MissingBase"
2223

testData/generator/StubFallback.expected.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* Copyright 2011-2025 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
3-
*/
4-
51
// ---- FooParser.java -----------------
62
//header.txt
73
package test;

tests/org/intellij/grammar/BnfGeneratorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public BnfGeneratorTest() {
2424
public void testTokenChoice() throws Exception { doGenTest(true); }
2525
public void testTokenChoiceNoSets() throws Exception { doGenTest(true); }
2626
public void testStub() throws Exception { doGenTest(true); }
27-
2827
public void testStubFallback() throws Exception {
2928
doGenTest(true);
3029
}

0 commit comments

Comments
 (0)