Quantcast

Need help with 'errorformat'

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help with 'errorformat'

Étienne Faure

Hello,

I'm using gvim with the visual studio plugin that can retreive (among
other things) the compilation output into the quickfix window.

My errorformat is:

let &errorformat='%f(%l) : %t%*\D%n: %m,%*[^"]"%f"%*\D%l: %m,%f(%l) :
%m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m'

I don't quite understand it completely, but it matches lines such as:

some\relative\path\file.cpp|42|error...

My question is, how can I make it understand, also, lines such as:

2>d:\absolute\path\file.cpp|42|error...

For now it just opens the file "2>d:\absolute\path\file.cpp", which does
not (and cannot) exist. I believe the "2" (which can be any number) is a
compilation counter (per lib compiled).

Thanks in advance,


--
Étienne

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with 'errorformat'

Mikalai Chaly


On Wed, Sep 30, 2009 at 4:13 PM, Tinou <[hidden email]> wrote:

Hello,

I'm using gvim with the visual studio plugin that can retreive (among
other things) the compilation output into the quickfix window.

My errorformat is:

let &errorformat='%f(%l) : %t%*\D%n: %m,%*[^"]"%f"%*\D%l: %m,%f(%l) :
%m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m'

I don't quite understand it completely, but it matches lines such as:

some\relative\path\file.cpp|42|error...

My question is, how can I make it understand, also, lines such as:

2>d:\absolute\path\file.cpp|42|error...

For now it just opens the file "2>d:\absolute\path\file.cpp", which does
not (and cannot) exist. I believe the "2" (which can be any number) is a
compilation counter (per lib compiled).

Thanks in advance,


--
Étienne


This output looks similar to that the "build.exe" DDK utility produces, as far as I remember, you can turn this numbering off there.

Try to add "%*[0123456789]%*[>]" in the beginning of your error format, for example:

:set errorformat=%*[0123456789]%*[>]%f(%l)\ :\ %t%*\\D%n:\ %m,%*[^\"]\"%f\"%*\\D%l:\ %m,%f(%l)\ :\ %m,%*[^\ ]\ %f\ %l:\ %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f\|%l\|\ %m


Mikalai
 

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with 'errorformat'

Mikalai Chaly
On Wed, Sep 30, 2009 at 5:21 PM, Mikalai Chaly <[hidden email]> wrote:


On Wed, Sep 30, 2009 at 4:13 PM, Tinou <[hidden email]> wrote:

Hello,

I'm using gvim with the visual studio plugin that can retreive (among
other things) the compilation output into the quickfix window.

My errorformat is:

let &errorformat='%f(%l) : %t%*\D%n: %m,%*[^"]"%f"%*\D%l: %m,%f(%l) :
%m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m'

I don't quite understand it completely, but it matches lines such as:

some\relative\path\file.cpp|42|error...

My question is, how can I make it understand, also, lines such as:

2>d:\absolute\path\file.cpp|42|error...

For now it just opens the file "2>d:\absolute\path\file.cpp", which does
not (and cannot) exist. I believe the "2" (which can be any number) is a
compilation counter (per lib compiled).

Thanks in advance,


--
Étienne


This output looks similar to that the "build.exe" DDK utility produces, as far as I remember, you can turn this numbering off there.

Try to add "%*[0123456789]%*[>]" in the beginning of your error format, for example:

:set errorformat=%*[0123456789]%*[>]%f(%l)\ :\ %t%*\\D%n:\ %m,%*[^\"]\"%f\"%*\\D%l:\ %m,%f(%l)\ :\ %m,%*[^\ ]\ %f\ %l:\ %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f\|%l\|\ %m


Mikalai
 

I've just found exact error format I've used with build, it look shorter: set errorformat=%*[0-9>]%f(%l) and so on.

Mikalai





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with 'errorformat'

Étienne Faure

> I've just found exact error format I've used with build, it look
> shorter: set errorformat=%*[0-9>]%f(%l) and so on.
>
> Mikalai
>

I've finaly got it working by setting an option:

g:visual_studio_quickfix_errorformat

to:

'%.%#%*[0-9>]\ %#%f(%l)\ :\ %m'

visual_studio.vim uses it to setlocal the efm...

Discovered on the way the :cfile command, very helpful.

It usually works, but sometimes VS gives me a relative path from god
knows where... Anyway, I've found a work around (as I don't have the
time to track down VS's start path for this or to make visual only
output absolute paths -- is this possible ?).

Thanks for the help!

--
Étienne

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Loading...