Repository navigation
Update GeneratedParserUtilBase to the platform state - #458
Merged
Max Medvedev (maxmedvedev) merged 16 commits intoAug 29, 2026
Merged
Max Medvedev (maxmedvedev) merged 16 commits into
Max Medvedev (maxmedvedev) merged 16 commits into
Conversation
Andrei Efanov (goto1134)
marked this pull request as draft
July 26, 2026 20:36
This was referenced Jul 26, 2026
GitOrigin-RevId: b3a4fd6e10ec2a36d3105eb9b97e5598c86d5326
GitOrigin-RevId: 1c7c1f53e4b573183d57e3c6cf1616ce1c3a1747
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.
Andrei Efanov (goto1134)
force-pushed
the
gpub-platform-floor-252
branch
from
August 24, 2026 10:43
16cf629 to
2df4452
Compare
Andrei Efanov (goto1134)
marked this pull request as ready for review
August 24, 2026 10:43
Max Medvedev (maxmedvedev)
self-requested a review
August 25, 2026 08:09
Max Medvedev (maxmedvedev)
requested changes
Aug 26, 2026
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
Max Medvedev (maxmedvedev)
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge after #457