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


Java ExpectedHighlightingData.init方法代码示例

本文整理汇总了Java中com.intellij.testFramework.ExpectedHighlightingData.init方法的典型用法代码示例。如果您正苦于以下问题:Java ExpectedHighlightingData.init方法的具体用法?Java ExpectedHighlightingData.init怎么用?Java ExpectedHighlightingData.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.testFramework.ExpectedHighlightingData的用法示例。


在下文中一共展示了ExpectedHighlightingData.init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
  data.init();

  PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
  getFile().getText(); //to load text
  myJavaFilesFilter.allowTreeAccessForFile(getVFile());
  getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, myTestRootDisposable); // check repository work

  try {
    Collection<HighlightInfo> infos = doHighlighting();

    data.checkResult(infos, getEditor().getDocument().getText(), filePath);
  }
  finally {
    getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:LightDaemonAnalyzerTestCase.java

示例2: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data) {
  data.init();
  PsiDocumentManager.getInstance(myProject).commitAllDocuments();

  //to load text
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      TreeUtil.clearCaches((TreeElement)myFile.getNode());
    }
  });


  //to initialize caches
  if (!DumbService.isDumb(getProject())) {
    CacheManager.SERVICE.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
  }
  final JavaPsiFacadeEx facade = getJavaFacade();
  if (facade != null) {
    facade.setAssertOnFileLoadingFilter(myVirtualFileFilter, myTestRootDisposable); // check repository work
  }

  try {
    Collection<HighlightInfo> infos = doHighlighting();

    String text = myEditor.getDocument().getText();
    data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
    data.checkResult(infos, text);
    return infos;
  }
  finally {
    if (facade != null) {
      facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, myTestRootDisposable);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:DaemonAnalyzerTestCase.java

示例3: doCustomHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
protected void doCustomHighlighting(boolean checkWeakWarnings, Boolean includeExternalToolPass) {
  final PsiFile file = myTestFixture.getFile();
  final Document doc = myTestFixture.getEditor().getDocument();
  ExpectedHighlightingData data = new ExpectedHighlightingData(doc, true, checkWeakWarnings, false, file);
  data.init();
  PsiDocumentManager.getInstance(myTestFixture.getProject()).commitAllDocuments();

  Collection<HighlightInfo> highlights1 = doHighlighting(includeExternalToolPass);

  data.checkResult(highlights1, doc.getText());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:HighlightingTestBase.java

示例4: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data) {
  data.init();
  PsiDocumentManager.getInstance(myProject).commitAllDocuments();

  //to load text
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      TreeUtil.clearCaches((TreeElement)myFile.getNode());
    }
  });


  //to initialize caches
  if (!DumbService.isDumb(getProject())) {
    CacheManager.SERVICE.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
  }
  final JavaPsiFacadeEx facade = getJavaFacade();
  if (facade != null) {
    facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter); // check repository work
  }

  Collection<HighlightInfo> infos = doHighlighting();

  if (facade != null) {
    facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);
  }

  String text = myEditor.getDocument().getText();
  data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
  data.checkResult(infos, text);
  return infos;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:35,代码来源:DaemonAnalyzerTestCase.java

示例5: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
  data.init();

  PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
  getFile().getText(); //to load text
  myJavaFilesFilter.allowTreeAccessForFile(getVFile());
  getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter); // check repository work

  Collection<HighlightInfo> infos = doHighlighting();

  getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE);

  data.checkResult(infos, getEditor().getDocument().getText(), filePath);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:LightDaemonAnalyzerTestCase.java

示例6: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
@NotNull
protected Collection<HighlightInfo> checkHighlighting(@NotNull final ExpectedHighlightingData data)
{
	data.init();
	PsiDocumentManager.getInstance(myProject).commitAllDocuments();

	//to load text
	ApplicationManager.getApplication().runWriteAction(new Runnable()
	{
		@Override
		public void run()
		{
			TreeUtil.clearCaches((TreeElement) myFile.getNode());
		}
	});


	//to initialize caches
	if(!DumbService.isDumb(getProject()))
	{
		CacheManager.getInstance(myProject).getFilesWithWord("XXX", UsageSearchContext.IN_COMMENTS, GlobalSearchScope.allScope(myProject), true);
	}
	final JavaPsiFacadeEx facade = getJavaFacade();
	if(facade != null)
	{
		facade.setAssertOnFileLoadingFilter(myFileTreeAccessFilter, null); // check repository work
	}

	Collection<HighlightInfo> infos = doHighlighting();

	if(facade != null)
	{
		facade.setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, null);
	}

	String text = myEditor.getDocument().getText();
	data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text);
	data.checkResult(infos, text);
	return infos;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:41,代码来源:DaemonAnalyzerTestCase.java

示例7: checkHighlighting

import com.intellij.testFramework.ExpectedHighlightingData; //导入方法依赖的package包/类
private void checkHighlighting(ExpectedHighlightingData data, String filePath) {
  data.init();

  PsiDocumentManager.getInstance(LightPlatformTestCase.getProject()).commitAllDocuments();
  LightPlatformCodeInsightTestCase.getFile().getText(); //to load text
  myJavaFilesFilter.allowTreeAccessForFile(LightPlatformCodeInsightTestCase.getVFile());
  LightCodeInsightTestCase.getJavaFacade().setAssertOnFileLoadingFilter(myJavaFilesFilter, null); // check repository work

  Collection<HighlightInfo> infos = doHighlighting();

  LightCodeInsightTestCase.getJavaFacade().setAssertOnFileLoadingFilter(VirtualFileFilter.NONE, null);

  data.checkResult(infos, LightPlatformCodeInsightTestCase.getEditor().getDocument().getText(), filePath);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:LightDaemonAnalyzerTestCase.java


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