mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[yaml] don't inject empty ranges (EA-865979, EA-865977)
GitOrigin-RevId: b0ffe3b9a7a6190a771c7f16ad9bfbf62d8ccb99
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7be215c18a
commit
729e8e5b05
@@ -12,7 +12,6 @@ import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiLanguageInjectionHost
|
||||
import org.jetbrains.yaml.psi.YAMLScalar
|
||||
import org.jetbrains.yaml.psi.impl.YAMLBlockScalarImpl
|
||||
import org.jetbrains.yaml.psi.impl.YAMLPlainTextImpl
|
||||
import org.jetbrains.yaml.psi.impl.YAMLScalarImpl
|
||||
|
||||
class YamlLanguageInjectionPerformer : LanguageInjectionPerformer {
|
||||
@@ -40,15 +39,14 @@ fun injectIntoYamlMultiRanges(registrar: MultiHostRegistrar,
|
||||
language: Language,
|
||||
prefix: String?,
|
||||
suffix: String?) {
|
||||
if (ranges.isEmpty()) return
|
||||
|
||||
registrar.startInjecting(language)
|
||||
|
||||
if (context is YAMLBlockScalarImpl)
|
||||
context.putUserData(InjectionMeta.INJECTION_INDENT, context.indentString)
|
||||
|
||||
if (ranges.isEmpty()) {
|
||||
// do nothing
|
||||
}
|
||||
else if (ranges.size == 1) {
|
||||
if (ranges.size == 1) {
|
||||
registrar.addPlace(prefix, suffix, context, ranges.single())
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user