Skip to content

Commit

Permalink
fix: fix unsupported methods usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathis Michel committed Oct 29, 2024
1 parent a2ca4fd commit 9f3646d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import com.intellij.psi.*
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageEditorUtil
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.util.elementType
import com.intellij.psi.util.endOffset
import com.intellij.psi.util.startOffset
import com.intellij.psi.xml.XmlTag
import com.intellij.psi.xml.XmlToken
import com.intellij.psi.xml.XmlTokenType
Expand Down Expand Up @@ -114,7 +112,7 @@ class StyledComponentsExtractor : PsiElementBaseIntentionAction(), IntentionActi
val tsVariable = varStatement.variables.firstOrNull() ?: return
val nameIdentifier = tsVariable.nameIdentifier ?: return

editor.caretModel.moveToOffset(nameIdentifier.startOffset)
editor.caretModel.moveToOffset(nameIdentifier.textOffset)
editor.scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE)

var scope = PsiTreeUtil.findCommonParent(tsVariable, tag)
Expand Down Expand Up @@ -172,12 +170,12 @@ class StyledComponentsExtractor : PsiElementBaseIntentionAction(), IntentionActi
.firstOrNull()

if (templateContentElement != null) {
editor.caretModel.moveToOffset(templateContentElement.endOffset - 1 - placeholderText.length)
editor.caretModel.moveToOffset(templateContentElement.textRange.endOffset - 1 - placeholderText.length)
editor.scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE)

editor.selectionModel.setSelection(
templateContentElement.endOffset - 1 - placeholderText.length,
templateContentElement.endOffset - 1
templateContentElement.textRange.endOffset - 1 - placeholderText.length,
templateContentElement.textRange.endOffset - 1
)
}

Expand Down

0 comments on commit 9f3646d

Please sign in to comment.