devonfw / cobigen

Code-based Incremental Generator
Apache License 2.0
35 stars 70 forks source link

Create proper error messages for external IncrementsRef #744

Open jdiazgon opened 6 years ago

jdiazgon commented 6 years ago

Expected behavior

As a user of CobiGen, I want proper error messages when my external IncrementRef is invalid so that I am able to understand the real problem and be able to fix it on my own.

Actual behavior

There is no proper error message when trying to generate templates that need different input files. There are two cases:

First case: If the templates to be generated do not use any VariableAssignment on their name (like environment.prod.ts.ftl) the following error window is shown:

image

A DeferredDocument is the variable containing the parsed UML input file.

Second case: If the templates to be generated do use VariableAssignment, the error message is the following:

image

This means that the Variables (like ${Variables.etoName})are null because the matcher could not resolve the input file.

We should create some kind of validation process before, so that a proper error message is shown to the user.

Use Case of feature request (enhancement)

  1. Define two triggers A and B. Trigger A only matches UML XML files while trigger B only matches Java files.
  2. Trigger A will contain some templates and increments. Trigger B will reference an increment of A.
  3. Define an external increment as the following:
  <increments>
    <increment name="external" description="Testing external IncrementRef">
      <incrementRef ref="TriggerA::IncrementOfA"/>
    </increment>
  </increments>

I want a proper error message stating that my external incrementRef is invalid because we are trying to generate from two triggers that make use of different inputs.

Related/Dependent Issues

678 #679

github-actions[bot] commented 5 years ago

Stale issue message