Skip to content

Commit

Permalink
fix bad replacing where quotes where duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
cottand committed Jul 7, 2024
1 parent d8086c8 commit f97fee3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/nixos/idea/psi/impl/AbstractNixString.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package org.nixos.idea.psi.impl
import com.intellij.lang.ASTNode
import com.intellij.openapi.diagnostic.Logger
import com.intellij.psi.PsiLanguageInjectionHost
import com.intellij.psi.impl.source.tree.LeafElement
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.util.IncorrectOperationException
import org.nixos.idea.psi.NixIndString
import org.nixos.idea.psi.NixString
import org.nixos.idea.psi.NixStringLiteralEscaper
Expand All @@ -21,8 +19,9 @@ abstract class AbstractNixString(private val astNode: ASTNode) : PsiLanguageInje
LOG.info("not a nix ind string")
return this
}
val withoutQuotes = s.substring(2..(s.lastIndex - 2))
(astNode.firstChildNode.treeNext.firstChildNode as? LeafPsiElement)
?.replaceWithText(s)
?.replaceWithText(withoutQuotes)
return this
}

Expand Down

0 comments on commit f97fee3

Please sign in to comment.