Commit 0abbd89
Kotlin: drop PsiTreeUtil from KDoc-section parsing for build portability
The KDoc-section parser located the parsed KDoc via
`com.intellij.psi.util.PsiTreeUtil.findChildOfType`. Like the
`ProcessCanceledException` reference fixed in the previous commit, this
`com.intellij` utility class is not present on every build's compiler
classpath: the reduced/relocated embeddable classpath used by the internal
extractor build strips it, so the build failed with
`unresolved reference 'PsiTreeUtil'`. The standalone language-test builds
(2.3.20, 2.4.0) bundle the full classpath and so did not catch it.
Replace the utility call with a small hand-written depth-first search over the
core `com.intellij.psi.PsiElement` navigation API (`firstChild`/`nextSibling`),
which is always available (it is already used by the PSI comment extractor).
The search has the same semantics as `findChildOfType`: it returns the first
KDoc descendant in pre-order, so the parsed sections are unchanged.
No expected-output changes: the KDoc lookup mechanism is behaviour-equivalent.
Verified the standalone extractor still builds for 1.8.0, 1.9.20-Beta and 2.4.0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 97199fd commit 0abbd89
1 file changed
Lines changed: 22 additions & 6 deletions
File tree
- java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_9_0-Beta
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
55 | 76 | | |
56 | 77 | | |
57 | 78 | | |
| |||
60 | 81 | | |
61 | 82 | | |
62 | 83 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 84 | + | |
69 | 85 | | |
70 | 86 | | |
71 | 87 | | |
| |||
0 commit comments