Skip to content

Commit

Permalink
Do not resolve if a dialect is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecKazakova committed Mar 28, 2023
1 parent 29ae623 commit 7da1153
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package app.cash.sqldelight.core.lang.psi

import app.cash.sqldelight.core.lang.types.typeResolver
import app.cash.sqldelight.core.lang.util.AnsiSqlTypeResolver
import com.alecstrong.sql.psi.core.SqlAnnotationHolder
import com.alecstrong.sql.psi.core.psi.SqlResultColumn
import com.alecstrong.sql.psi.core.psi.impl.SqlFunctionExprImpl
import com.intellij.lang.ASTNode

internal class FunctionExprMixin(node: ASTNode?) : SqlFunctionExprImpl(node) {
override fun annotate(annotationHolder: SqlAnnotationHolder) {
if (parent is SqlResultColumn && typeResolver.functionType(this) == null) {
if (parent is SqlResultColumn &&
typeResolver != AnsiSqlTypeResolver &&
typeResolver.functionType(this) == null
) {
annotationHolder.createErrorAnnotation(this, "Unknown function ${functionName.text}")
}
}
Expand Down

0 comments on commit 7da1153

Please sign in to comment.