writing a custom Eclipse validator

点点圈 提交于 2020-01-02 05:23:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!