cashapp / sqldelight

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

SQLDelight Plugin does not work with Android Studio Koala #5310

Open Appsoluts opened 1 week ago

Appsoluts commented 1 week ago

SQLDelight Version

2.0.2

IDE Version

Android Studio Koala | 2024.1.1

Dialect

SQLite

Describe the Bug

After moving from AS Jelly to Koala, the SQLD plugin throws errors which seem to break IDE highlighting thoroughly:

Disabling the SQLD plugin fixes the problem.

Stacktrace

This can be found in the .cache/Google/AS.../logs/idea.log file:

2024-06-20 11:06:44,755 [8213988]   INFO - SQLDelight[fohlen-android-app] - Setting up SQLite Dialect
2024-06-20 11:06:44,755 [8213988]   INFO - SQLDelight[Tracker] - Setting up SQLite Dialect
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR - Exception in thread "DefaultDispatcher-worker-22" java.lang.NoSuchMethodError: 'java.util.stream.Stream com.intellij.openapi.extensions.ExtensionPoint.extensions()'
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at app.cash.sqldelight.dialects.sqlite_3_18.SqliteDialect.registerTypeHolder(SqliteDialect.kt:50)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at app.cash.sqldelight.dialects.sqlite_3_18.SqliteDialect.setup(SqliteDialect.kt:31)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at app.cash.sqldelight.core.lang.ParserUtil.initializeDialect(ParserUtil.kt:23)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at app.cash.sqldelight.core.lang.SqlDelightParserDefinition.createParser(SqlDelightParserDefinition.kt:51)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at app.cash.sqldelight.core.lang.SqlDelightParserDefinition.createParser(SqlDelightParserDefinition.kt:28)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at com.intellij.psi.tree.ILightStubFileElementType.parseContentsLight(ILightStubFileElementType.java:50)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at com.intellij.psi.impl.source.tree.FileElement.getLighterAST(FileElement.java:49)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at com.intellij.util.indexing.FileContentImpl.getLighterAST(FileContentImpl.java:59)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at com.intellij.psi.stubs.StubTreeBuilder.lambda$buildStubTree$3(StubTreeBuilder.java:140)
2024-06-20 11:06:44,756 [8213989]   INFO - STDERR -     at com.intellij.psi.impl.PsiManagerImpl.runInBatchFilesMode(PsiManagerImpl.java:462)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:132)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:198)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:176)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:145)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:30)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:19)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.impl.MapReduceIndex.mapByIndexer(MapReduceIndex.java:318)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:309)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.impl.MapReduceIndex.mapInputAndPrepareUpdate(MapReduceIndex.java:254)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndexStorage.mapInputAndPrepareUpdate(StubUpdatingIndexStorage.java:62)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.psi.stubs.StubUpdatingIndexStorage.mapInputAndPrepareUpdate(StubUpdatingIndexStorage.java:22)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.createSingleIndexValueApplier(FileBasedIndexImpl.java:1590)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$22(FileBasedIndexImpl.java:1460)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.lambda$freezeFileTypeTemporarilyWithProvidedValueIn$15(FileTypeManagerImpl.java:731)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.cacheFileTypesInside(FileTypeManagerImpl.java:795)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyWithProvidedValueIn(FileTypeManagerImpl.java:727)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1413)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1387)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.processRefreshedFile(FileBasedIndexImpl.java:1332)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1701)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1695)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.UpdateTask.process(UpdateTask.java:63)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.UpdateTask.processAll(UpdateTask.java:32)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.forceUpdate(FileBasedIndexImpl.java:1718)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:810)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexEx.processAllKeys(FileBasedIndexEx.java:148)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexImpl.processAllKeys(FileBasedIndexImpl.java:838)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexEx.processAllKeys(FileBasedIndexEx.java:134)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.util.indexing.FileBasedIndexEx.getAllKeys(FileBasedIndexEx.java:128)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at org.jetbrains.kotlin.idea.versions.KotlinRuntimeLibraryUtilKt.getLibraryRootsWithAbiIncompatibleVersion(KotlinRuntimeLibraryUtil.kt:64)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at org.jetbrains.kotlin.idea.versions.KotlinRuntimeLibraryUtilKt.getLibraryRootsWithIncompatibleAbiJvm(KotlinRuntimeLibraryUtil.kt:41)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at org.jetbrains.kotlin.idea.versions.KotlinRuntimeLibraryUtilKt.getLibraryRootsWithIncompatibleAbi(KotlinRuntimeLibraryUtil.kt:31)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at org.jetbrains.kotlin.idea.versions.UnsupportedAbiVersionNotificationPanelProvider.collectNotificationData(UnsupportedAbiVersionNotificationPanelProvider.kt:201)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1$result$1.invoke(EditorNotificationsImpl.kt:229)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1$result$1.invoke(EditorNotificationsImpl.kt:226)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:108)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:16)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:95)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:94)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1$lambda$0(cancellableReadAction.kt:38)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.impl.RwLockHolder.tryRunReadAction(RwLockHolder.kt:310)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:958)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1(cancellableReadAction.kt:36)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke(cancellableReadAction.kt:34)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:320)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:309)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:31)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:94)
2024-06-20 11:06:44,757 [8213990]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:78)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:65)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:16)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invokeSuspend(InternalReadAction.kt:44)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invoke(InternalReadAction.kt)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invoke(InternalReadAction.kt)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.InternalReadAction.runReadAction(InternalReadAction.kt:40)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.executeReadAction(PlatformReadWriteActionSupport.kt:38)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.ReadWriteActionSupport.executeReadAction$default(ReadWriteActionSupport.kt:15)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.CoroutinesKt.constrainedReadAction(coroutines.kt:58)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.openapi.application.CoroutinesKt.readAction(coroutines.kt:25)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at com.intellij.ui.EditorNotificationsImpl$updateEditors$job$1.invokeSuspend(EditorNotificationsImpl.kt:226)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
2024-06-20 11:06:44,758 [8213991]   INFO - STDERR -     Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ProjectImpl@672194185), CoroutineName(EditorNotificationsImpl), LazyStandaloneCoroutine{Cancelling}@6af65348, Dispatchers.Default]
VitaliyBelyaev commented 5 days ago

I faced with the same problem after moving from Jelly to Koala.

On all kt files I get Syntax highlighting error, only all steps in Repair IDE flow help, after reindex all project error disappear, but then it appear again and all sq files non-editable.

Android Studio Koala | 2024.1.1
Build #AI-241.15989.150.2411.11948838, built on June 11, 2024
Runtime version: 17.0.10+0-17.0.10b1087.21-11609105 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.5
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.jetbrains.kmm (0.8.2(241)-6)
  com.squareup.sqldelight (2.0.2)
MMauro94 commented 3 days ago

Same problem in IntelliJ 2024.1.3, Build #IC-241.17890.1