How to use OpenFileDescriptor?

hi ...
im writing a plugin to work with maven similar to ant.
when i get an compile-error i want be able to jump to
the given position. at the moment i use the following approach

fileEditorManager.openFile(new OpenFileDescriptor(vFile,
errorInfo.getLineNumber().intValue(), 0), ScrollType.MAKE_VISIBLE, true);

the problem with this is, that idea jumps 2 lines farther then it should?
is the linenumber a line index? or whats the preferred way of doing such a
thing

thanks in advance

christian koestlin



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 28.08.2003


2 comments
Comment actions Permalink

Your code looks right. So I think the problem is in line numbering. In our
editor first line has index 0.
But I can't imagine how you've managed to miss 2 lines...

--
Best regards,
Dmitry Peshehonov
JetBrains, Inc, http://www.intellij.com

"Develop with pleasure!"

"Christian Köstlin" <christian.koestlin@bmw-carit.de> wrote in message
news:biprhc$oeb$1@is.intellij.net...

hi ...
im writing a plugin to work with maven similar to ant.
when i get an compile-error i want be able to jump to
the given position. at the moment i use the following approach

>

fileEditorManager.openFile(new OpenFileDescriptor(vFile,
errorInfo.getLineNumber().intValue(), 0), ScrollType.MAKE_VISIBLE, true);

>

the problem with this is, that idea jumps 2 lines farther then it should?
is the linenumber a line index? or whats the preferred way of doing such a
thing

>

thanks in advance

>

christian koestlin

>
>
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 28.08.2003

>
>


0
Comment actions Permalink

Your code looks right. So I think the problem is in line numbering. In our
editor first line has index 0.
But I can't imagine how you've managed to miss 2 lines...

oopps .. my error ... the dirst line goes to the first line is 0, the second
line was the "wrong" compiler message.

thanks ...

p.s.: does a complete openapi-javadoc exist? im missing it in the idea-doc
directory in the 908 build.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 28.08.2003


0

Please sign in to leave a comment.