Skip to content

Commit

Permalink
fix: do not auto import the current file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alaanor committed May 14, 2022
1 parent 8c05dfb commit 2de9e94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/com/github/alaanor/candid/psi/CandidFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.github.alaanor.candid.CandidFileType
import com.github.alaanor.candid.CandidLanguage
import com.github.alaanor.candid.CandidTypes
import com.github.alaanor.candid.icon.CandidIcons
import com.github.alaanor.candid.util.filePath
import com.github.alaanor.candid.util.getRelativePath
import com.intellij.extapi.psi.PsiFileBase
import com.intellij.openapi.fileTypes.FileType
Expand All @@ -30,7 +31,7 @@ class CandidFile(fileViewProvider: FileViewProvider) : PsiFileBase(fileViewProvi
val imports = getImports()
val exists = imports.find { requiredImportPath == it.importPathString() } != null

if (exists) {
if (exists || this.filePath() == declaration.filePath()) {
return
}

Expand Down

0 comments on commit 2de9e94

Please sign in to comment.