Skip to content

Update GeneratedParserUtilBase to the platform state - #458

Merged
Max Medvedev (maxmedvedev) merged 16 commits into
JetBrains:masterfrom
goto1134:gpub-platform-floor-252
Aug 29, 2026
Merged

Max Medvedev (maxmedvedev) merged 16 commits into
JetBrains:masterfrom
goto1134:gpub-platform-floor-252

Conversation

@goto1134

Copy link
Copy Markdown
Contributor

Merge after #457

@goto1134 Andrei Efanov (goto1134) changed the title Gpub platform floor 252 Update GeneratedParserUtilBase to the platform state Jul 26, 2026
@goto1134
Andrei Efanov (goto1134) marked this pull request as draft July 26, 2026 20:36
asedunov and others added 13 commits August 24, 2026 12:42
GitOrigin-RevId: b3a4fd6e10ec2a36d3105eb9b97e5598c86d5326
GitOrigin-RevId: 1c7c1f53e4b573183d57e3c6cf1616ce1c3a1747
GitOrigin-RevId: ecdc5a39ee8610b094ae89cd35e535777c7b4137
Three GeneratedParserUtilBase commits need APIs newer than 233:
PsiBuilder.getProductions(), SyntaxTreeBuilder.Production, the members lifted onto
PsiBuilder.Marker, and DummyBlockType. DummyBlockType arrives in 252, so 251 is not
enough.

252 also delegates isWhitespaceOrComment and getProductions from PsiBuilderAdapter,
which keeps the replay free of local workarounds.

Adopting the platform isWhitespaceOrComment call on 233 is not an option. There it is
an interface default returning false that PsiBuilderImpl does not override, so
whitespace detection would break silently instead of failing to compile.

This commit does not compile on its own. The collapsed-marker check calls
PsiBuilderImpl.isCollapsed(ProductionMarker), which 252 moves onto ProductionMarker;
the next commit rewrites the call.
… the number of downcasts to PsiBuilderImpl

GitOrigin-RevId: 505cb3d1bfe37c6cfb829c67b5fe39351cc4c30b
GitOrigin-RevId: 1eb4d68ee8aa983b3c5f79068feaf544b6feed8d
GitOrigin-RevId: 952a525157ad40b74e974f61d326d72459fe7386
…on intellij.platform.analysis.impl from syntax-psi

GitOrigin-RevId: d25bcbe58af7621e67a373924a901eb7ae5bb50d
From 252 PsiBuilderAdapter delegates getProductions() identically, and the runtime
reads productions through PsiBuilder. This finishes platform commit 2c2be8e, whose
third hunk the 233 floor could not take.
…arker

Lifting the marker members onto PsiBuilder.Marker reintroduced a cast. This finishes
platform commit 7ecd528, whose second hunk had nothing to rewrite while the method
returned PsiBuilderImpl.ProductionMarker.
Generated impls repeat every constructor of their PSI superclass. 2025.2 adds a fourth
to StubBasedPsiElementBase, taking a stub and an IElementType, so stub-based impls gain
a matching one.

The unused Experimental import alongside it is recorded as the generator emits it
today; the next commit removes it.
…tions

The import collection took these annotations while the emitter writes parameter
annotations only, so they never reached the output and their imports went unused.
2025.2 is the first supported build with an annotated PSI superclass constructor, which
is why nothing surfaced the path before.

Omitting the annotation itself is deliberate: JetBrains#399 removed the invalid @experimental
generation.
@goto1134
Andrei Efanov (goto1134) marked this pull request as ready for review August 24, 2026 10:43
Code that walks a chunked tree needs the chunk size, so it moves from private, next to
checkSiblings, to the other class-level constants.

The platform copy of GeneratedParserUtilBase keeps its MAX_CHILDREN_IN_TREE private, so
this diverges deliberately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ates

DUMMY_BLOCK became DummyBlockType.DUMMY_BLOCK, so its element type builds
DummyBlockType.DummyBlock nodes and nothing instantiates the GeneratedParserUtilBase
subclass. Every instanceof against the subclass was dead: getDummyAwarePrevSibling no
longer descended into or climbed out of chunks, and isLastInRuleOrFree no longer reported
a free position.

parseGrammar chunks top-level items, so this reaches any grammar of one chunk or more. The
existing completion tests use one- or two-rule grammars and stayed green. GrammarUtilTest
covers the walk directly; testKeywordsInChunkedGrammar covers completion in a chunked
grammar, where the position lands inside the chunk and the walk already worked.

The subclass stays for source compatibility, as it does in the platform copy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
intellij-monorepo-bot pushed a commit to JetBrains/intellij-community that referenced this pull request Aug 28, 2026
DummyBlockType.DummyBlock replaced this class, and nothing in the platform
instantiates the old one anymore. Grammar-Kit already deprecated its own
copy of the class in PR JetBrains/Grammar-Kit#458.

GitOrigin-RevId: f3d90f819fcb3c6025a1429799e9d238aa447d44
@maxmedvedev
Max Medvedev (maxmedvedev) merged commit 8dfe697 into JetBrains:master Aug 29, 2026
5 checks passed
@goto1134
Andrei Efanov (goto1134) deleted the gpub-platform-floor-252 branch August 29, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants