Eclipse Markers

I’m trying to develop a plugin for Eclipse that uses jslint to validate your JavaScript. This involves scanning all the JavaScript code, and using markers to say where the problem lies.

I’ve almost got this done. But there was the slight problem that when I clicked on the problem view, it took me to the beginning of the file (more or less) instead of the line I should have gone to.

After hours of searching, wading through the debugger, etc, I finally managed to figure out what was going on.

  • You can’t set IMarker.LINE_NUMBER and IMarker.CHAR_START together—they’re mutually exclusive.
  • IMarker.CHAR_START and IMarker.CHAR_END refer to offsets from the start of the file, not the start of the line.

Needless to say, this is not documented anywhere. Eclipse is feeling rather programmer-hostile right now.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s