mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
xhtml whitespaces should be left as they were
This commit is contained in:
@@ -13,6 +13,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import com.intellij.psi.impl.source.SourceTreeToPsiMap;
|
||||
import com.intellij.psi.impl.source.parsing.ParseUtil;
|
||||
import com.intellij.psi.impl.source.tree.*;
|
||||
import com.intellij.util.CharTable;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
@@ -412,6 +413,10 @@ public class CodeEditUtil {
|
||||
LOG.assertTrue(firstAsPsiElement != null);
|
||||
final PsiFile file = firstAsPsiElement.getContainingFile();
|
||||
final PseudoTextBuilder pseudoTextBuilder = language.getFormatter();
|
||||
if(pseudoTextBuilder == null){
|
||||
final LeafElement leafElement = ParseUtil.nextLeaf((TreeElement)first, null);
|
||||
if(leafElement != second) return leafElement.getText();
|
||||
}
|
||||
LOG.assertTrue(pseudoTextBuilder != null);
|
||||
final Project project = firstAsPsiElement.getProject();
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(project).getCurrentSettings();
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
package com.intellij.psi.impl.source.xml;
|
||||
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.impl.source.tree.CompositePsiElement;
|
||||
@@ -18,6 +20,7 @@ import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.xml.XmlElement;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.Language;
|
||||
|
||||
public abstract class XmlElementImpl extends CompositePsiElement implements XmlElement {
|
||||
public XmlElementImpl(IElementType type) {
|
||||
@@ -59,4 +62,9 @@ public abstract class XmlElementImpl extends CompositePsiElement implements XmlE
|
||||
final int textOffset = getStartOffset();
|
||||
return new TextRange(textOffset, textOffset + getTextLength());
|
||||
}
|
||||
|
||||
public Language getLanguage() {
|
||||
final FileType fileType = getContainingFile().getFileType();
|
||||
return ((LanguageFileType)fileType).getLanguage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,9 +234,4 @@ public class XmlTextImpl extends XmlElementImpl implements XmlText {
|
||||
myDisplayText = null;
|
||||
myGaps = null;
|
||||
}
|
||||
|
||||
public Language getLanguage() {
|
||||
final FileType fileType = getContainingFile().getFileType();
|
||||
return ((LanguageFileType)fileType).getLanguage();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user