Results 1 to 4 of 4
  1. #1
    X-ion is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default 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.

  2. #2
    X-ion is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default

    B(ring)
    U(p)
    M(y)
    P(ost)

  3. #3
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    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.

  4. #4
    X-ion is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default

    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

  1. Help with Eclipse SWT - OLE plugin
    By nmarathe in forum Eclipse
    Replies: 4
    Last Post: 03-11-2009, 01:37 PM
  2. plugin for using jsf in eclipse
    By shu2hua in forum Eclipse
    Replies: 0
    Last Post: 05-30-2008, 05:54 AM
  3. AnyEdit Plugin For Eclipse Plugin
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-18-2007, 12:28 PM
  4. plugin for eclipse
    By sin in forum Eclipse
    Replies: 1
    Last Post: 05-10-2007, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •