SyntaxChecker#checkSyntax result should be aware of includes

0 votes
asked Jun 4, 2015 in Wanted features by krasa (820 points)
edited Jun 7, 2015 by krasa
Currently it returns a line number from an inlined document, from which it is impossible to find out where the error really is, resulting in a misleading error to the user.

 

When there is an error in an included file, the check should return an error on a line with the parent !include - in the main source. And perhaps also additional detail of the error and line number in the included file.

1 Answer

0 votes
answered Jun 12, 2015 by plantuml (295,000 points)
Hi,
 
Good suggestion!
 
We have started to implement this feature.
Before adding this to SyntaxChecker#checkSyntax we would like to test it.
 
So we've slightly changed the information PlantUML displays when there is a syntax error.
We now provide the complete file path (and correct line number) in the error description.
And if the error is in some included file, we also provide the name of this file.
 
If the new printed data are relevant for you, we will add them in the API.
 
Note that we are not sure whether it's a good idea to add the complete file path on the generated image.
It may be usefull for people running PlantUML from the command line.
But for people using PlantUML as a plugin, we will then display the name and path of a probably temporary file used by this plugin. So it may be confusing for users.
 
Any though?
 
Thanks again!
commented Jun 12, 2015 by krasa (820 points)
Hello,

looks good. I think that it would be better to display a relative path from  the basedir. And if anyone uses temporary files, then the relative path should also be fine.

At least in IntelliJ, the only thing really needed would be to return a proper line number from the SyntaxChecker, so that the editor can display a warning on the !include line, and not like this: http://i.imgur.com/PMUTitK.png


Cheers.
...