Results 1 to 4 of 4
Thread: Eclipse plugin, custom errors
- 02-18-2010, 11:13 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 9
- Rep Power
- 0
Eclipse plugin, custom errors
Hello all,
What i want is to make my own custom problems, get them detected by the compiler and show them in the problems view. Now the custom errors can be anything like a annotation placed on a setter while it only works on a getter, the compiler says its ok, runtime = error.
I somehow need the compiler to check for these custom errors, thing is i dont know how to:
a: Create the general errors (Thats in setting the message and stuff, the icon).
b: How to analyze the code finding the errors and fill in things like line number, filename and stuff.
Does anybody have a simple example of how to do this?
About (a): What i did find out is that i probably need the compilationParticipant reconcile function, that means i also need a reconcileContext in which i can put my problems, which are CategorizedProblems and implement the IProblem interface. So far so good.
About (b): What i dont know is how to get the compiler to find the error in the code and generate the IProblem (what i said, linenumber, sourcefile and on). I've found out about Markers, but i dont know if that will work just fine? I dont quite get the link yet. So can anybody help me?
Greetz and thanks in advance.
- 02-22-2010, 09:15 AM #2
Member
- Join Date
- Feb 2010
- Posts
- 9
- Rep Power
- 0
B(ring)
U(p)
M(y)
P(ost)
- 02-22-2010, 10:47 AM #3
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
What language is the code written in?
e.g if it's in Java then you can instantiate a compiler and pass it the code.
It will give you the error messages.
- 02-22-2010, 11:24 AM #4
Member
- Join Date
- Feb 2010
- Posts
- 9
- Rep Power
- 0
Hello R0,
Yes its in java, problem is, i wanna generate custom errors, so i want to put markers where the compiler finds a problem, but this problem should be a custom problem, so not one of the standard IProblems...
Any way to do that? Like search for a pattern in files (Compiler should do this but i dunno how), and add a marker?
The way im trying to fix it now, is by making my own builder, add a nature and markers when i find something, this isnt working yet, but im close i think :)
Anyway if you have a suggestion lemme know.
Thanks
Similar Threads
-
Help with Eclipse SWT - OLE plugin
By nmarathe in forum EclipseReplies: 4Last Post: 03-11-2009, 01:37 PM -
plugin for using jsf in eclipse
By shu2hua in forum EclipseReplies: 0Last Post: 05-30-2008, 05:54 AM -
AnyEdit Plugin For Eclipse Plugin
By JavaForums in forum EclipseReplies: 0Last Post: 05-18-2007, 12:28 PM -
plugin for eclipse
By sin in forum EclipseReplies: 1Last Post: 05-10-2007, 07:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks