Wednesday, November 7, 2012

Re: Quickfix - use Vim's "path" variable

Nathan Neff wrote:

> Vim has a path variable that it uses when you
> press "gf" to jump to a file. Unfortunately, the
> Quickfix window doesn't do that.
>
> I'm trying to use the output of junit tests as the
> input to Quickfix. Unfortunately, I only have the filename of
> the java test that failed, not the absolute path.
>
> So, my errors file only has this:
>
> TestFoo.java:19:junit.framework.ComparisonFailure: null
> expected:<[b]ar> but was:<[B]ar>
> TestFoo.java:24:junit.framework.ComparisonFailure: null expected:<baz>
> but was:<null>
>
> And when I use :cn or :cp to jump to the errors, Vim creates a new
> "TestFoo.java" file
> instead of jumping to src/TestFoo.java where it actually lives..
>
> Is there a way to get Vim's quick fix window to use Vim's "path" variable,
> or am I forced to put the path of TestFoo.java in the errors file?

I have remapped "gf" myself to find files in more places, and also to
mangle the name in various ways. E.g. when importing TheClass it
searches for TheClass.java in the path.

This is not a nice way of doing this. It should be easier and more
automatic, so that not every user has to set this up. Perhaps some
chain of filters, where the first one that finds the file returns it
full name. The filters could be installed by filetype plugins. With
some variables, e.g. to set the Java class loader path.

--
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother...she doesn't have a modem.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: