Skip to content

Commit

Permalink
Skip multi resolve item when is in dumb mode (#885)
Browse files Browse the repository at this point in the history
* skip multi resolve item when is in dumb mode

* Update CHANGELOG.md
  • Loading branch information
koxudaxi authored Feb 21, 2024
1 parent 7f677d8 commit 38b755c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## [Unreleased]
- Skip multi resolve item when is in dumb mode [[#885](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/885)]
- Fix `@model_validator(mode="before")` causes "Problematic nesting of decorators" inspection false positive [[#882](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/882)]
- Support 241 EAP [[#879](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/879)]
- Inspect undefined field [[#858](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/858)]
Expand Down
3 changes: 3 additions & 0 deletions src/com/koxudaxi/pydantic/PydanticTypeProvider.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.koxudaxi.pydantic

import com.intellij.openapi.project.DumbService
import com.intellij.openapi.util.Ref
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
Expand Down Expand Up @@ -285,6 +286,8 @@ class PydanticTypeProvider : PyTypeProviderBase() {
): PydanticDynamicModelClassType? {
val arguments = pyCallExpression.arguments.toList()
if (arguments.isEmpty()) return null
// If the project is dumb, we can't resolve the function
if (DumbService.isDumb(pyCallExpression.project)) return null
val pyFunction = pyCallExpression.multiResolveCalleeFunction(PyResolveContext.defaultContext(context))
.asSequence()
.filterIsInstance<PyFunction>()
Expand Down

0 comments on commit 38b755c

Please sign in to comment.