Wednesday, March 3, 2010

Re: how to make cscope output with full path of the file name?

On 2010-03-03, yixiaodafang@gmail.com wrote:

> On Mar 3, 12:51 pm, Gary Johnson <garyj...@spocom.com> wrote:
> > On 2010-03-03, yixiaodaf...@gmail.com wrote:
> > > Hi,
> >
> > > I am using cscope to search and the result is displayed in the
> > > quickfix window. I want the result to list the full path of each
> > > search result. Currently, it only displays part of the path and
> > > causing a lot of problme for me. Does anyone know how to get the full
> > > path for each result listed in the quickfix window after cscope
> > > command?
> >
> > When you create a cscope database (or symbol cross-reference) by
> > just running "cscope -R" in some directory, the database will
> > contain the names of files relative to that directory.  That is a
> > problem if vim is using a different current directory when it
> > accesses the database.
> >
> > One solution is to give the name of the directory in which cscope
> > was run to the ":cs add" command as the "pre-path" argument.  See
> > ":help E563".
> >
> > Another solution is to give cscope a list of the files it is to
> > search when it builds its database, and use the full path names to
> > the files in that list.  You can easily build such a list using the
> > find command.

> Hi, Gary,
>
> Thanks for trying help me.
>
> My database is created by cscope -b -k -q. The files with full path is
> in the file cscope.files.
>
> I searched the help and find the cspc setting. base on the help. if I
> set cspc to zero, the cscope result will be displayed as a full path.
> It does display the full path if I do not use quickfix (use the
> default output). However, if I use the quickfix, this settting does
> not have any effect on the output. Is this a bug in vim?

I think that the way file names are displayed in the quickfix window
is a property of the quickfix feature, not of the cscope feature.
Therefore, I don't think that 'cspc' having no effect on the
quickfix display is a bug. I think that 'cspc' is intended to
affect only the output of a cscope command when it is displayed
directly on the screen.

I don't know why your quickfix window does not display the full path
name of each file, though. Mine does. I wonder if there is some
character in your full path names that the quickfix parser thinks is
a filename separator. If you think that might be the case, take a
look at ":help isfname".

The vim version I used for testing this was 7.2.327 on Linux. The
database was created using

cscope -b -q -k -i $FILE_LIST -f $DATABASE

where FILE_LIST was created using find and contains the full path
names of all files.

Regards,
Gary

--
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: