当前位置: 首页>>代码示例>>Java>>正文


Java DebugUtil.psiToString方法代码示例

本文整理汇总了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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:PsiViewerDialog.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:PsiViewerDialog.java

示例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());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:PsiViewerDialog.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ParsingTestCase.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PythonReparseTest.java

示例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());
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:6,代码来源:LuaParsingTestCase.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ParsingTestCase.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CompletionAssertions.java

示例9: dumpUrl

import com.intellij.psi.impl.DebugUtil; //导入方法依赖的package包/类
static @NotNull String dumpUrl(@NotNull UrlUrl url) {
  return DebugUtil.psiToString(url, true, false);
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:4,代码来源:Util.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:ParsingTestCase.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ParsingTestCase.java


注:本文中的com.intellij.psi.impl.DebugUtil.psiToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。