本文整理汇总了Java中com.intellij.psi.impl.DebugUtil.psiToString方法的典型用法代码示例。如果您正苦于以下问题:Java DebugUtil.psiToString方法的具体用法?Java DebugUtil.psiToString怎么用?Java DebugUtil.psiToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.impl.DebugUtil
的用法示例。
在下文中一共展示了DebugUtil.psiToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActions
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected Action[] createActions() {
AbstractAction copyPsi = new AbstractAction("Cop&y PSI") {
@Override
public void actionPerformed(@NotNull ActionEvent e) {
PsiElement element = parseText(myEditor.getDocument().getText());
List<PsiElement> allToParse = new ArrayList<PsiElement>();
if (element instanceof PsiFile) {
allToParse.addAll(((PsiFile)element).getViewProvider().getAllFiles());
}
else if (element != null) {
allToParse.add(element);
}
String data = "";
for (PsiElement psiElement : allToParse) {
data += DebugUtil.psiToString(psiElement, !myShowWhiteSpacesBox.isSelected(), true);
}
CopyPasteManager.getInstance().setContents(new StringSelection(data));
}
};
return ArrayUtil.mergeArrays(new Action[]{copyPsi}, super.createActions());
}
示例2: createActions
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected Action[] createActions() {
AbstractAction copyPsi = new AbstractAction("Cop&y PSI") {
@Override
public void actionPerformed(ActionEvent e) {
PsiElement element = parseText(myEditor.getDocument().getText());
List<PsiElement> allToParse = new ArrayList<PsiElement>();
if (element instanceof PsiFile) {
allToParse.addAll(((PsiFile)element).getViewProvider().getAllFiles());
}
else if (element != null) {
allToParse.add(element);
}
String data = "";
for (PsiElement psiElement : allToParse) {
data += DebugUtil.psiToString(psiElement, !myShowWhiteSpacesBox.isSelected(), true);
}
CopyPasteManager.getInstance().setContents(new StringSelection(data));
}
};
return ArrayUtil.mergeArrays(new Action[]{copyPsi}, super.createActions());
}
示例3: createActions
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
@Nonnull
@Override
protected Action[] createActions() {
AbstractAction copyPsi = new AbstractAction("Cop&y PSI") {
@Override
public void actionPerformed(ActionEvent e) {
PsiElement element = parseText(myEditor.getDocument().getText());
List<PsiElement> allToParse = new ArrayList<PsiElement>();
if (element instanceof PsiFile) {
allToParse.addAll(((PsiFile)element).getViewProvider().getAllFiles());
}
else if (element != null) {
allToParse.add(element);
}
String data = "";
for (PsiElement psiElement : allToParse) {
data += DebugUtil.psiToString(psiElement, !myShowWhiteSpacesBox.isSelected(), true);
}
CopyPasteManager.getInstance().setContents(new StringSelection(data));
}
};
return ArrayUtil.mergeArrays(new Action[]{copyPsi}, super.createActions());
}
示例4: ensureCorrectReparse
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
public static void ensureCorrectReparse(@NotNull final PsiFile file) {
final String psiToStringDefault = DebugUtil.psiToString(file, false, false);
final String fileText = file.getText();
final DiffLog diffLog = new BlockSupportImpl(file.getProject()).reparseRange(
file, TextRange.allOf(fileText), fileText, new EmptyProgressIndicator(), fileText);
diffLog.performActualPsiChange(file);
TestCase.assertEquals(psiToStringDefault, DebugUtil.psiToString(file, false, false));
}
示例5: doTest
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
private void doTest(final String typedText) throws InterruptedException {
final String testName = getTestName(false);
myFixture.configureByFile("reparse/" + testName + ".py");
myFixture.type(typedText);
PsiDocumentManager.getInstance(myFixture.getProject()).commitAllDocuments();
final String actualPsiText = DebugUtil.psiToString(myFixture.getFile(), false);
myFixture.configureByText(testName + ".py", myFixture.getEditor().getDocument().getText());
final String expectedPsiText = DebugUtil.psiToString(myFixture.getFile(), false);
assertEquals(expectedPsiText, actualPsiText);
}
示例6: checkParsing
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
protected void checkParsing(String input, String output) {
final PsiFile psiFile = TestUtils.createPseudoPhysicalLuaFile(getProject(), input);
String psiTree = DebugUtil.psiToString(psiFile, false, true);
assertEquals(output.trim(), psiTree.trim());
}
示例7: toParseTreeText
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
protected static String toParseTreeText(PsiElement file, boolean skipSpaces, boolean printRanges) {
return DebugUtil.psiToString(file, skipSpaces, printRanges);
}
示例8: createAstAttachment
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
private static Attachment createAstAttachment(PsiFile fileCopy, final PsiFile originalFile) {
return new Attachment(originalFile.getViewProvider().getVirtualFile().getPath() + " syntactic tree.txt", DebugUtil.psiToString(fileCopy, false, true));
}
示例9: dumpUrl
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
static @NotNull String dumpUrl(@NotNull UrlUrl url) {
return DebugUtil.psiToString(url, true, false);
}
示例10: toParseTreeText
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
protected static String toParseTreeText(final PsiElement file, boolean skipSpaces, boolean printRanges) {
return DebugUtil.psiToString(file, skipSpaces, printRanges);
}
示例11: toParseTreeText
import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
protected static String toParseTreeText(final PsiElement file, boolean skipSpaces, boolean printRanges) {
return DebugUtil.psiToString(file, skipSpaces, printRanges);
}