Skip to content

Commit ceee8f2

Browse files
authored
Update ModuleParserUtil to fix infinite loop (#730)
* Update ModuleParserUtil.kt Prevent infinite loop when tokenType is null This causes the Idea plugin to hang Ide process * Update CHANGELOG.md
1 parent 1670616 commit ceee8f2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Fix Ide hang when using code completion in virtual table module (https://github.com/sqldelight/sql-psi/pull/730)
56
- Support numeric literals when using virtual table module arguments (https://github.com/sqldelight/sql-psi/pull/728)
67

78
## [0.7.2] - 2025-11-12

core/src/main/kotlin/com/alecstrong/sql/psi/core/ModuleParserUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class ModuleParserUtil : GeneratedParserUtilBase() {
2222
)
2323
columnName.parse(builder, level + 1)
2424
var parens = 0
25-
while (builder.tokenType != SqlTypes.COMMA) {
25+
while (builder.tokenType != null && builder.tokenType != SqlTypes.COMMA) {
2626
if (builder.tokenType == SqlTypes.LP) parens++
2727
if (builder.tokenType == SqlTypes.RP && (--parens == -1)) break
2828
builder.advanceLexer()

0 commit comments

Comments
 (0)