org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider Java Examples

The following examples show how to use org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LazyLinkingResource.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.3
 */
protected void createAndAddDiagnostic(Triple<EObject, EReference, INode> triple, IllegalNodeException ex) {
	if (isValidationDisabled())
		return;
	ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext context = createDiagnosticMessageContext(triple);
	DiagnosticMessage message = linkingDiagnosticMessageProvider.getIllegalNodeMessage(context, ex);
	if (message != null) {
		List<Diagnostic> list = getDiagnosticList(message);
		Diagnostic diagnostic = createDiagnostic(triple, message);
		if (!list.contains(diagnostic))
			list.add(diagnostic);
	}
}
 
Example #2
Source File: DefaultXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @since 2.9
 */
public Class<? extends ILinkingDiagnosticMessageProvider> bindILinkingDiagnosticMessageProvider() {
	return UnresolvedFeatureCallTypeAwareMessageProvider.class;
}
 
Example #3
Source File: DefaultXbaseWithAnnotationsRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinkingDiagnosticMessageProvider> bindILinkingDiagnosticMessageProvider() {
	return UnresolvedAnnotationTypeAwareMessageProvider.class;
}
 
Example #4
Source File: UnresolvedFeatureCallTypeAwareMessageProvider.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public DiagnosticMessage getUnresolvedProxyMessage(final ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext context) {
  String _xtrycatchfinallyexpression = null;
  try {
    _xtrycatchfinallyexpression = context.getLinkText();
  } catch (final Throwable _t) {
    if (_t instanceof IllegalNodeException) {
      final IllegalNodeException e = (IllegalNodeException)_t;
      _xtrycatchfinallyexpression = e.getNode().getText();
    } else {
      throw Exceptions.sneakyThrow(_t);
    }
  }
  String linkText = _xtrycatchfinallyexpression;
  if ((linkText == null)) {
    return null;
  }
  EObject contextObject = context.getContext();
  boolean _isStaticMemberCallTarget = this.isStaticMemberCallTarget(contextObject);
  if (_isStaticMemberCallTarget) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append(linkText);
    _builder.append(" cannot be resolved to a type.");
    return new DiagnosticMessage(_builder.toString(), Severity.ERROR, Diagnostic.LINKING_DIAGNOSTIC, 
      UnresolvedFeatureCallTypeAwareMessageProvider.TYPE_LITERAL);
  }
  if ((contextObject instanceof XAbstractFeatureCall)) {
    boolean _isOperation = ((XAbstractFeatureCall)contextObject).isOperation();
    boolean _not = (!_isOperation);
    if (_not) {
      return this.handleUnresolvedFeatureCall(context, ((XAbstractFeatureCall)contextObject), linkText);
    }
  }
  EClass referenceType = context.getReference().getEReferenceType();
  StringConcatenation _builder_1 = new StringConcatenation();
  _builder_1.append(linkText);
  _builder_1.append(" cannot be resolved");
  String _typeName = this.getTypeName(referenceType, context.getReference());
  _builder_1.append(_typeName);
  _builder_1.append(".");
  final String msg = _builder_1.toString();
  return new DiagnosticMessage(msg, Severity.ERROR, Diagnostic.LINKING_DIAGNOSTIC, linkText);
}
 
Example #5
Source File: DomainmodelUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ILinkingDiagnosticMessageProvider> bindILinkingDiagnosticMessageProvider() {
	return DomainmodelLinkingDiagnosticMessageProvider.class;
}
 
Example #6
Source File: LazyLinkingResource.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected DiagnosticMessage createDiagnosticMessage(Triple<EObject, EReference, INode> triple) {
	ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext context = createDiagnosticMessageContext(triple);
	DiagnosticMessage message = diagnosticMessageProvider.getUnresolvedProxyMessage(context);
	return message;
}
 
Example #7
Source File: LazyLinkingResource.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public ILinkingDiagnosticMessageProvider getDiagnosticMessageProvider() {
	return diagnosticMessageProvider;
}
 
Example #8
Source File: LazyLinkingResource.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider diagnosticMessageProvider) {
	this.diagnosticMessageProvider = diagnosticMessageProvider;
}
 
Example #9
Source File: Linker.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setDiagnosticMessageProvider(ILinkingDiagnosticMessageProvider.Extended diagnosticMessageProvider) {
	this.diagnosticMessageProvider = diagnosticMessageProvider;
}
 
Example #10
Source File: Linker.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public ILinkingDiagnosticMessageProvider.Extended getDiagnosticMessageProvider() {
	return diagnosticMessageProvider;
}
 
Example #11
Source File: XtextRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ILinkingDiagnosticMessageProvider.Extended> bindILinkingDiagnosticMessageProvider() {
	return XtextLinkingDiagnosticMessageProvider.class;
}
 
Example #12
Source File: AbstractSCTResource.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected DiagnosticMessage createDiagnosticMessage(Triple<EObject, EReference, INode> triple) {
	ILinkingDiagnosticMessageProvider.ILinkingDiagnosticContext context = createDiagnosticMessageContext(triple);
	DiagnosticMessage message = diagnosticMessageProvider.getUnresolvedProxyMessage(context);
	return message;
}
 
Example #13
Source File: GamlRuntimeModule.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
public Class<? extends ILinkingDiagnosticMessageProvider.Extended> bindILinkingDiagnosticMessageProvider() {
	return GamlLinkingErrorMessageProvider.class;
}
 
Example #14
Source File: XtxtUMLRuntimeModule.java    From txtUML with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends ILinkingDiagnosticMessageProvider> bindILinkingDiagnosticMessageProvider() {
	return XtxtUMLLinkingDiagnosticMessageProvider.class;
}