Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show syntax errors in an eclipse editor plugin
    primarykey
    data
    text
    <p>How can I indicate syntax errors (e.g. an illegal sequence of tokens) in an eclipse editor plugin just like in the eclipse Java editor, i.e. by red wriggly underlines, a red marker on the scrollbar that you can jump to, and an explanatory message when you hover over either one?</p> <p>I'm writing an eclipse editor plugin for a custom file format (specifically, the "snake file format" of the Shark3D game engine). I have implemented a scanner to get syntax highlighting, and an outline. </p> <ul> <li>For the underlines, do I simply have the scanner return an <code>IToken</code> with a "wriggly underline" <code>TextAttribute</code> instead of the normal one, or is there a specific mechanism for marking syntax errors? </li> <li>How do I implement the scrollbar markers? Is <code>IAnnotationModel</code> the relevant interface here? If so, where do I register the implementation so that the markers appear? </li> <li>I've only found <code>SourceViewerConfiguration.getAnnotationHover()</code>, which would allow me to implement the hover behaviour, but only for the "annotation", which I suppose means the scrollbar markers - how do I implement the hover behaviour for the text itself?</li> </ul> <p>I'd be happy specific advice as well as an URL of a tutorial that covers this - the eclipse help documents and examples don't seem to.</p> <p><strong>Edit:</strong> Markers are the best solutions to this. A working example of how to use them can be found in the plugin example code in <code>org.eclipse.ui.examples.readmetool.AddReadmeMarkerAction</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload