Skip to content

Commit

Permalink
feat(refactoring): move check flag before run #132.
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 3, 2024
1 parent c1cc521 commit a6a2e63
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -18,10 +18,10 @@ class RenameLookupManagerListener(val project: Project) : LookupManagerListener
private val llm = LlmFactory.instance.create(project)

override fun activeLookupChanged(oldLookup: Lookup?, newLookup: Lookup?) {
val lookupImpl = newLookup as? LookupImpl ?: return

if (!project.coderSetting.state.enableRenameSuggestion) return

val lookupImpl = newLookup as? LookupImpl ?: return

val lookupOriginalStart = lookupImpl.lookupOriginalStart
val startOffset = if (lookupOriginalStart > -1) lookupOriginalStart else 0
val psiElement = lookupImpl.psiFile?.findElementAt(startOffset)
Expand Down

0 comments on commit a6a2e63

Please sign in to comment.