cashapp / sqldelight

SQLDelight - Generates typesafe Kotlin APIs from SQL
https://cashapp.github.io/sqldelight/
Apache License 2.0
6.13k stars 513 forks source link

Idea plugin not creating files #5420

Open WildOrangutan opened 2 weeks ago

WildOrangutan commented 2 weeks ago

SQLDelight Version

2.0.2

IDE Version

Android Studio Koala | 2024.1.1 Patch 2

Dialect

SQLite

Describe the Bug

When using the IntelliJ plugin, when I try to create any kind of file inside (File, Table or Migration), nothing happens (image)

I have a Kotlin multiplatform project. My gradle file setup is as follows:

sqldelight {
    databases {
        create(name = "MyDatabase") {
            packageName = "com.example.app.db"
        }
    }
}

Stacktrace

There is no stacktrace in idea.log. This is the only line, that is printed out:

INFO - SQLDelight[DailyPulse] - Setting up SQLite Dialect
WildOrangutan commented 2 weeks ago

After manually creating a file, and trying to edit it, my cursor freezes. IDE is still responding, but sql file is not. Following stacktrace is shown in logs:

2024-08-26 10:33:28,547 [3823718]   WARN - #c.i.p.s.StubUpdatingIndexStorage - mapInputAndPrepareUpdate interrupted,inputId=4715316,java.lang.NoSuchMethodError: 'java.util.stream.Stream com.intellij.openapi.extensions.ExtensionPoint.extensions()'
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR - Exception in thread "DefaultDispatcher-worker-7" java.lang.NoSuchMethodError: 'java.util.stream.Stream com.intellij.openapi.extensions.ExtensionPoint.extensions()'
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at app.cash.sqldelight.dialects.sqlite_3_18.SqliteDialect.registerTypeHolder(SqliteDialect.kt:50)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at app.cash.sqldelight.dialects.sqlite_3_18.SqliteDialect.setup(SqliteDialect.kt:31)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at app.cash.sqldelight.core.lang.ParserUtil.initializeDialect(ParserUtil.kt:23)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at app.cash.sqldelight.core.lang.SqlDelightParserDefinition.createParser(SqlDelightParserDefinition.kt:51)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at app.cash.sqldelight.core.lang.SqlDelightParserDefinition.createParser(SqlDelightParserDefinition.kt:28)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.tree.ILightStubFileElementType.parseContentsLight(ILightStubFileElementType.java:50)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.impl.source.tree.FileElement.getLighterAST(FileElement.java:49)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.util.indexing.FileContentImpl.getLighterAST(FileContentImpl.java:59)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.stubs.StubTreeBuilder.lambda$buildStubTree$3(StubTreeBuilder.java:140)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.impl.PsiManagerImpl.runInBatchFilesMode(PsiManagerImpl.java:462)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:132)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:198)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:176)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:145)
2024-08-26 10:33:28,548 [3823719]   INFO - STDERR -     at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:30)
...
2024-08-26 10:33:28,551 [3823722]   INFO - STDERR -     Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ProjectImpl@1960994984), CoroutineName(EditorNotificationsImpl), LazyStandaloneCoroutine{Cancelling}@fcf189, Dispatchers.Default]
WildOrangutan commented 2 weeks ago

After disabling IdeaVim and restarting IDE, sqldelight started working. Even if I re-enable IdeaVim 🤷🏼‍♂️