Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Getting the line number of the config file
Getting the line number of the config file [message #1749935] Wed, 14 December 2016 01:44 Go to next message
Eclipse UserFriend
I am using xcore, and trying to create my own validator class.
If there is a problem with the config, I want to display an error message like this:
File name(line number): error message

The File name can be taken from the resource's URI, but I did not find any method that will give me the line number in the file where the resource is configured. How do I get the line number?
Re: Getting the line number of the config file [message #1749936 is a reply to message #1749935] Wed, 14 December 2016 01:59 Go to previous messageGo to next message
Eclipse UserFriend
hi you have to calculate the line number from the node model. see org.eclipse.xtext.validation.DiagnosticConverterImpl.getLocationData(Diagnostic)

what i dont get is: why dont you simply use xtexts validator infrastructure and let xtext do the job for you
Re: Getting the line number of the config file [message #1750012 is a reply to message #1749936] Thu, 15 December 2016 01:39 Go to previous message
Eclipse UserFriend
I don't mainly rely on the input from the xtext grammar, I have to do some preprocessing before I can check for the validity, thus, I created my own validator.
Or is it possible to use the xtext validator after doing some preprocessing?
Previous Topic:Implementing java web editor
Next Topic:Embedded Editor wont list references to an external Ecore model
Goto Forum:
  


Current Time: Mon May 12 15:54:52 EDT 2025

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

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

Back to the top