问题
I have a custom file format that I'd like validated by eclipse. In other words when I view this file in the eclipse editor I'd like a red squiggly line to show up under errors. This seems like it should be a pretty easy thing to do. Can someone point me in the write direction?
回答1:
As mentioned by Konstantin, Xtext is a great way if you can define your complete format. If you just want to validate one aspect of some complex format, it might be easier to manually create markers on the file, see http://www.eclipsepluginsite.com/builders-natures-markers.html and How to show syntax errors in an eclipse editor plugin
回答2:
Take a look at Xtext project for a framework that gives you a way to define a new language and produces an editor, validation, code completion, etc. in return.
来源:https://stackoverflow.com/questions/4904076/writing-a-custom-eclipse-validator