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


Java Issue.IssueImpl方法代码示例

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


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

示例1: createPostProcessingFailedError

import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
private Issue createPostProcessingFailedError(N4JSResource res, Throwable th) {
	final String thKind = th instanceof Error ? "error" : (th instanceof Exception ? "exception" : "throwable");
	final String thName = th.getClass().getSimpleName();
	final String trace = "\n" + Stream.of(th.getStackTrace())
			.map(ste -> ste.toString())
			.collect(Collectors.joining("\n")); // cannot add indentation, because Xtext would reformat the message
	final String msg = IssueCodes.getMessageForPOST_PROCESSING_FAILED(thKind, thName, th.getMessage() + trace);
	final Issue.IssueImpl issue = new Issue.IssueImpl();
	issue.setCode(IssueCodes.POST_PROCESSING_FAILED);
	issue.setSeverity(IssueCodes.getDefaultSeverity(IssueCodes.POST_PROCESSING_FAILED));
	issue.setMessage(msg);
	issue.setUriToProblem(EcoreUtil.getURI(res.getScript()));
	issue.setType(CheckType.FAST); // using CheckType.FAST is important to get proper marker update behavior in ...
	// ... the editor between persisted and dirty states!
	issue.setOffset(0);
	issue.setLength(0);
	issue.setLineNumber(0);
	issue.setColumn(0);
	return issue;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:N4JSResourceValidator.java

示例2: synthesizeIssuesForFollowUpErrors

import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
protected void synthesizeIssuesForFollowUpErrors(Resource resource, List<Issue> result) {
	List<EObject> contents = resource.getContents();
	if (!contents.isEmpty()) {
		IResolvedTypes resolvedTypes = typeResolver.resolveTypes(contents.get(0));
		for(ILinkingCandidate linkingCandidate: resolvedTypes.getFollowUpErrors()) {
			XExpression expression = linkingCandidate.getExpression();
			IssueImpl issue = new Issue.IssueImpl();
			issue.setUriToProblem(EcoreUtil.getURI(linkingCandidate.getExpression()));
			if (expression instanceof XAbstractFeatureCall)
				issue.setMessage(((XAbstractFeatureCall) expression).getConcreteSyntaxFeatureName() + " cannot be resolved");
			else {
				List<INode> nodes = NodeModelUtils.findNodesForFeature(expression, XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR);
				if (nodes.size() >= 1) {
					issue.setMessage(nodes.get(0).getText() + " cannot be resolved");
				}
			}
			result.add(issue);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:ElementIssueProvider.java

示例3: testBugFix322645

import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
/**
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=322645
 */
@Test public void testBugFix322645() throws Exception {
	Issues issues = issues();
	Issue a = new Issue.IssueImpl();
	Issue b = new Issue.IssueImpl();
	issues.addError("foo", a);
	issues.addWarning(null, a);
	issues.addError(null, b);
	MWEDiagnostic[] errors = issues.getErrors();
	assertEquals(2, errors.length);
	final Validator validator = new Validator();
	final String string = validator.toString(issues);
	assert(string.contains("foo"));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:17,代码来源:ValidatorTest.java

示例4: reportProjectIssue

import org.eclipse.xtext.validation.Issue; //导入方法依赖的package包/类
public void reportProjectIssue(final String message, final String code, final Severity severity) {
  Issue.IssueImpl _issueImpl = new Issue.IssueImpl();
  final Procedure1<Issue.IssueImpl> _function = (Issue.IssueImpl it) -> {
    it.setMessage(message);
    it.setCode(code);
    it.setSeverity(severity);
    it.setUriToProblem(this.baseDir);
  };
  Issue.IssueImpl _doubleArrow = ObjectExtensions.<Issue.IssueImpl>operator_doubleArrow(_issueImpl, _function);
  this.issueAcceptor.apply(this.baseDir, Collections.<Issue>unmodifiableList(CollectionLiterals.<Issue>newArrayList(_doubleArrow)));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:12,代码来源:ProjectManager.java


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