private StringBuilder createIssueMessage(Issue issue) { StringBuilder issueBuilder = new StringBuilder("\n"); issueBuilder.append(issue.getSeverity()).append(": \t"); URI uriToProblem = issue.getUriToProblem(); if (uriToProblem != null) { URI resourceUri = uriToProblem.trimFragment(); issueBuilder.append(resourceUri.lastSegment()).append(" - "); if (resourceUri.isFile()) { issueBuilder.append(resourceUri.toFileString()); } } issueBuilder.append("\n").append(issue.getLineNumber()).append(": ").append(issue.getMessage()); return issueBuilder; }
protected void appendMessages(StringBuilder result, MWEDiagnostic[] diagnostics) { Multimap<URI, MWEDiagnostic> issuesPerURI = groupByURI(diagnostics); boolean first = true; for (URI uri : issuesPerURI.keySet()) { if (!first) result.append('\n'); first = false; if (uri != null) { result.append('\t').append(uri.lastSegment()).append(" - "); if (uri.isFile()) result.append(uri.toFileString()); else result.append(uri); } for (MWEDiagnostic diagnostic : issuesPerURI.get(uri)) { Issue issue = (Issue) diagnostic.getElement(); result.append("\n\t\t").append(issue.getLineNumber()).append(": ").append(diagnostic.getMessage()); } } }
public static PProblem toPProblem(Issue issue) { return new PProblem(issue.getMessage(), issue.getLineNumber(), issue.getColumn()); } }
public ScriptParsingException addValidationIssues(Iterable<Issue> validationErrors) { for (Issue validationError : validationErrors) { this.getErrors().add( new ScriptError(validationError.getMessage(), validationError.getLineNumber(), validationError .getOffset(), validationError.getLength())); } return this; }
public int compare(MWEDiagnostic o1, MWEDiagnostic o2) { Issue issue1 = (Issue) o1.getElement(); Issue issue2 = (Issue) o2.getElement(); int lineNumberCompare = nullSafeCompare(issue1.getLineNumber(), issue2.getLineNumber()); if (lineNumberCompare != 0) { return lineNumberCompare; } int offsetCompare = nullSafeCompare(issue1.getOffset(), issue2.getOffset()); if (offsetCompare != 0) { return offsetCompare; } return Strings.notNull(o1.getMessage()).compareTo(Strings.notNull(o2.getMessage())); }
/** Create a message for the issue. * * @param issue the issue. * @return the message. */ protected String createIssueMessage(Issue issue) { final IssueMessageFormatter formatter = getIssueMessageFormatter(); final org.eclipse.emf.common.util.URI uriToProblem = issue.getUriToProblem(); if (formatter != null) { final String message = formatter.format(issue, uriToProblem); if (message != null) { return message; } } if (uriToProblem != null) { final org.eclipse.emf.common.util.URI resourceUri = uriToProblem.trimFragment(); return MessageFormat.format(Messages.SarlBatchCompiler_4, issue.getSeverity(), resourceUri.lastSegment(), resourceUri.isFile() ? resourceUri.toFileString() : "", //$NON-NLS-1$ issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); } return MessageFormat.format(Messages.SarlBatchCompiler_5, issue.getSeverity(), issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); }
return cmp; cmp = compareSafe(issue1.getLineNumber(), issue2.getLineNumber()); if (cmp != 0) { return cmp;
/** * Compute the validation result for the given document. This method should not be called * directly from the service dispatcher; use {@link #getResult(XtextWebDocumentAccess)} instead * in order to avoid duplicate computations. */ @Override public ValidationResult compute(final IXtextWebDocument it, final CancelIndicator cancelIndicator) { final List<Issue> issues = this.resourceValidator.validate(it.getResource(), CheckMode.ALL, cancelIndicator); final ValidationResult result = new ValidationResult(); final Function1<Issue, Boolean> _function = (Issue it_1) -> { Severity _severity = it_1.getSeverity(); return Boolean.valueOf((!Objects.equal(_severity, Severity.IGNORE))); }; final Consumer<Issue> _function_1 = (Issue issue) -> { List<ValidationResult.Issue> _issues = result.getIssues(); String _message = issue.getMessage(); String _translate = this.translate(issue.getSeverity()); Integer _lineNumber = issue.getLineNumber(); Integer _column = issue.getColumn(); Integer _offset = issue.getOffset(); Integer _length = issue.getLength(); ValidationResult.Issue _issue = new ValidationResult.Issue(_message, _translate, _lineNumber, _column, _offset, _length); _issues.add(_issue); }; IterableExtensions.<Issue>filter(issues, _function).forEach(_function_1); return result; }
it.setMessage(issue.getMessage()); Integer _elvis = null; Integer _lineNumber = issue.getLineNumber(); if (_lineNumber != null) { _elvis = _lineNumber;
/** * @since 2.0 */ protected void setMarkerAttributes(Issue issue, IResource resource, IMarker marker) throws CoreException { String lineNR = ""; if (issue.getLineNumber() != null) { lineNR = "line: " + issue.getLineNumber() + " "; } marker.setAttribute(IMarker.LOCATION, lineNR + resource.getFullPath().toString()); marker.setAttribute(Issue.CODE_KEY, issue.getCode()); marker.setAttribute(IMarker.SEVERITY, getSeverity(issue)); marker.setAttribute(IMarker.CHAR_START, issue.getOffset()); if(issue.getOffset() != null && issue.getLength() != null) marker.setAttribute(IMarker.CHAR_END, issue.getOffset()+issue.getLength()); marker.setAttribute(IMarker.LINE_NUMBER, issue.getLineNumber()); marker.setAttribute(IMarker.MESSAGE, issue.getMessage()); if (issue.getUriToProblem()!=null) marker.setAttribute(Issue.URI_KEY, issue.getUriToProblem().toString()); if(issue.getData() != null && issue.getData().length > 0) { marker.setAttribute(Issue.DATA_KEY, Strings.pack(issue.getData())); } if (resolutionProvider != null && resolutionProvider.hasResolutionFor(issue.getCode())) { marker.setAttribute(FIXABLE_KEY, true); } }
filename, issue.getLineNumber(), issue.getColumn(), issue.getMessage()); });