Hi Robert,
I'm trying to debug another anomaly, but Vim crashes when I call
SmartTag#SmartTag("debug").
Cursor is on "func()" call in main().
Here is source file:
class ABC
{
public:
virtual void func (void) const = 0;
};
class Derived1 : public ABC
{
public:
virtual void func (void) const
{
};
};
class Derived2 : public ABC
{
public:
virtual void func (void) const
{
};
};
class Derived3 : public Derived1
{
public:
virtual void func (void) const
{
Derived1::func();
};
static Derived3 *instance (void)
{
}
};
int main (int argc, char *argv[])
{
Derived3::instance()->func();
}
Here is tags file:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not
append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.6 //
ABC test.cc /^class ABC$/;" c file:
Derived1 test.cc /^class Derived1 : public ABC$/;" c
file: inherits:ABC
Derived1::func test.cc /^ virtual void func (void) const$/;"
f class:Derived1 signature:(void) const
Derived2 test.cc /^class Derived2 : public ABC$/;" c
file: inherits:ABC
Derived2::func test.cc /^ virtual void func (void) const$/;"
f class:Derived2 signature:(void) const
Derived3 test.cc /^class Derived3 : public Derived1$/;" c
file: inherits:Derived1
Derived3::func test.cc /^ virtual void func (void) const$/;"
f class:Derived3 signature:(void) const
Derived3::instance test.cc /^ static Derived3 *instance
(void)$/;" f class:Derived3 signature:(void)
func test.cc /^ virtual void func (void) const$/;" f
class:Derived1 signature:(void) const
func test.cc /^ virtual void func (void) const$/;" f
class:Derived2 signature:(void) const
func test.cc /^ virtual void func (void) const$/;" f
class:Derived3 signature:(void) const
instance test.cc /^ static Derived3 *instance (void)$/;"
f class:Derived3 signature:(void)
main test.cc /^int main (int argc, char *argv[])$/;" f
signature:(int argc, char *argv[])
test.cc test.cc 1;" F
Is there anything else I can do to help?
Scott.
On Fri, Nov 25, 2011 at 9:16 AM, Scott Smedley <[email protected]> wrote:
> Hi Robert,
>
> Thanks for your reply.
>
>> I would have to see the full context. I use it all the time and it works
>> well for the majority of cases, but there are always things that can trip it
>> up, and it depends a lot on the contents of your current file and the file
>> containing any matching tags.
>>
>> Send me your .cpp file (and .h file if required) and tags file, in case mine
>> generates differently. And I'll see what I can see, though it's been a
>> while since I looked at this.
>
> Hmmm, I investigated a bit further & discovered that the search
> pattern in the tags file appears to match multiple lines in the source
> file:
>
> devaus120>> grep ::func tags
> Derived1::func test.cc /^ virtual void func (void) const$/;"
> f class:Derived1 signature:(void) const
> Derived2::func test.cc /^ virtual void func (void) const$/;"
> f class:Derived2 signature:(void) const
>
> Here is the source:
>
> class ABC
> {
> public:
> virtual void func (void) const = 0;
> };
>
> class Derived1 : public ABC
> {
> public:
> virtual void func (void) const
> {
> };
> };
>
> class Derived2 : public Derived1
> {
> public:
> virtual void func (void) const
> {
> Derived1::func();
> };
> };
>
> When I put cursor on "Derived1::func();", SmartTag takes me to the
> implementation of Derived2::func(). ie 2 lines above the cursor. Which
> is a bit strange cos that must mean that the search finds the *last*
> occurance of the search pattern.
>
> Here is my tags file, generated with: ctags --extra=fq --fields=+iS test.cc
>
> !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not
> append ;" to lines/
> !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
> !_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
> !_TAG_PROGRAM_NAME Exuberant Ctags //
> !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
> !_TAG_PROGRAM_VERSION 5.6 //
> ABC test.cc /^class ABC$/;" c file:
> Derived1 test.cc /^class Derived1 : public ABC$/;" c
> file: inherits:ABC
> Derived1::func test.cc /^ virtual void func (void) const$/;"
> f class:Derived1 signature:(void) const
> Derived2 test.cc /^class Derived2 : public Derived1$/;" c
> file: inherits:Derived1
> Derived2::func test.cc /^ virtual void func (void) const$/;"
> f class:Derived2 signature:(void) const
> func test.cc /^ virtual void func (void) const$/;" f
> class:Derived1 signature:(void) const
> func test.cc /^ virtual void func (void) const$/;" f
> class:Derived2 signature:(void) const
> test.cc test.cc 1;" F
>
> Scott.
>
--
You received this message from the "vim_dev" 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