Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Validation of Cross-references to Derived Objects is Sketchy - How to debug?
Validation of Cross-references to Derived Objects is Sketchy - How to debug? [message #1811012] Fri, 23 August 2019 10:47 Go to next message
Eclipse UserFriend
In my current DSL, I am providing a DerivedStateComputer and installing its derived state when !preLinkingPhase is true (i.e. we are not in the preLinkingPhase).

My derived state is quite complicated because the file format I'm retrofitting this DSL to has ambiguity and a lot of implicit declarations. I can't change the grammar.

I make many crossreferences to derived objects that have been "installed" into various resources - thousands of crossreferences. All of this seems to work in general - i.e. once I get validation running, the crossreferences work and I don't get an error.

However, I'm finding that when I launch my Eclipse instance to test the editor, many of the files are showing that they have errored crossreferences - both in the Project Explorer, the editor itself, and the Problems view.

If I right click and select Validate, the errors go away. But why am I having to manually validate crossreferences? Shouldn't this be done automatically?

I'll open a file and it'll be almost completely red, I manually run validation and almost all of the red goes away.

I have other custom validation that suffers from the same problem where I mark certain items with INFO. When I launch eclipse and a file is open in the DSL editor, I'll have INFO markers in a number of places where I should not. If i manually invoke Validation, they will clean up.

If I select Project -> Clean, I will do a clean rebuild of my project, intially I will get 5000 errors, but then suddenly, the error count will jump to 8000+ and nearly all of those additional 3000 are errored crossreferences to derived objects that would get cleaned up if I did a manual validation of all 150+ files .

I have no idea where to start debugging this. What type of coding errors could lead to this?

Using the DerivedStateComputer is supposed to be the "safe" way to add these derived objects and is compliant with the various phases of compilation, cross linking, and validation. So I'm pretty confused.

Do I need to programmatically kick off a validation whenever I open a file?

[Updated on: Wed, 28 August 2019 10:56] by Moderator

Re: Validation of Cross-references to Derived Objects is Sketchy - How to debug? [message #1811200 is a reply to message #1811012] Wed, 28 August 2019 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Is there a way for me to write a custom validator that re-triggers the crossreference check?

Does this issue stem from the fact that my DerivedState is installed after the preLinkingPhase? I, unfortunately, need access to the index while calculating the derived state. Has the linking already taken place before I've made the objects to be cross-referenced?

If there was a simple custom validator I could write that says "okay, do the link validation again", that would probably be good enough. I can't manually open 150+ files and trigger a manual validation obviously.
Re: Validation of Cross-references to Derived Objects is Sketchy - How to debug? [message #1811212 is a reply to message #1811200] Wed, 28 August 2019 13:20 Go to previous message
Eclipse UserFriend
This goes beyond what I can do here for you.
If you have that issue your inferrer / derived state computer is wrong
Also the scale issue you mention makes no sense . The same problem should be there with small files
Previous Topic:xtend template generator not working in deployed app
Next Topic:[OT] Looking for some help reviving an old Xtext project
Goto Forum:
  


Current Time: Wed Mar 19 19:47:19 EDT 2025

Powered by FUDForum. Page generated in 0.07518 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top