I'm trying to setup SmartTag. The plugin appears to load ok, however
when I put my cursor on "method" on the text "Class::method", it does
not detect the right class. When I show debug info it says: "Type: T".
What do I need to do to get SmartTag working with such a simple case?
FYI, default key mappings did not work (ie. <C-_><C-_>) but I created
others which work fine.
I am using:
Centos 5.5
Vim 7.0
ctags 5.6
SmartTags downloaded from http://github.com/MarcWeber/SmartTag today.
Any pointers muchly appreciated.
Scott.
> I'm trying to setup SmartTag. The plugin appears to load ok, however
> when I put my cursor on "method" on the text "Class::method", it does
> not detect the right class. When I show debug info it says: "Type: T".
>
> What do I need to do to get SmartTag working with such a simple case?
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.
Thanks,
Rob.
--
Robert Webb <Stel...@gmail.com>,
Want to make polyhedra?
http://www.software3d.com/Stella.php
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 /dhie...@users.sourceforge.net/
!_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.
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 /dhie...@users.sourceforge.net/
!_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.
> 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.
I tried this and it worked for me, going straight to Derived1::func().
By the way, pasting tags files into an email really doesn't work. They
require tabs which get converted to spaces. I think I converted it back OK,
and it seemed to work for me, using either your tags file or mine.
Do you have a version of vim which includes Lech Loren's patches to help
with the SmartTag plugin? As far as I know they never made it into the main
release (which is why I haven't upgraded for some time, still on 7.2). I'll
CC Lech. Lech, is there somewhere I can get the latest vim with your
patches included?
The other possible difference would be if my version of the plugin differs
from the one in git (possible since someone else set up git for me and I
never took the time to figure out how to use it myself). I attach my
version here. Let me know if it differs, and if so, whether it makes a
difference.
Thanks,
Rob.
--
Robert Webb <Stel...@gmail.com>,
MineSweeper3D - Take Minesweeper to a whole new dimension.
http://www.software3d.com/Mines3D
> I'm trying to debug another anomaly, but Vim crashes when I call
> SmartTag#SmartTag("debug").
I haven't looked into this, but I presume that any crash is a bug in vim
itself rather than my plugin (or at worst, they both have a bug).
On 25 November 2011 11:29, Robert Webb <stel...@gmail.com> wrote:
> Do you have a version of vim which includes Lech Loren's patches to help
> with the SmartTag plugin? As far as I know they never made it into the main
> release (which is why I haven't upgraded for some time, still on 7.2). I'll
> CC Lech. Lech, is there somewhere I can get the latest vim with your
> patches included?
I do, but it also includes a number of other patches. I'll try to
extract the SmartTag
part tomorrow and put it somewhere on the web.
--
Pozdrawiam,
Lech Lorens
> Hey Scott,
>
> > 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.
>
> I tried this and it worked for me, going straight to Derived1::func().
Oops, I should have tested further. I added a line "Derived2::func()" and
that also goes to Derived1::func() for me, so I'm getting the same problem
but instead of always going to the second one, it is always going to the
first one.
As it builds the list of possible tags, it should be removing the ones where
the class doesn't match, so I don't know why that's not working in this
case. I don't have time to try to re-understand my code in any depth right
now, but will let you know if I figure it out. Otherwise, let me know if
you figure it out :-)
Rob.
--
Robert Webb <Stel...@gmail.com>,
Software developer
http://www.software3d.com
On Fr, 25 Nov 2011, Scott Smedley wrote:
> I'm trying to debug another anomaly, but Vim crashes when I call
> SmartTag#SmartTag("debug").
Can you provide an easy example of how to crash Vim?
regards,
Christian
>> I'm trying to debug another anomaly, but Vim crashes when I call
>> SmartTag#SmartTag("debug").
>
> Can you provide an easy example of how to crash Vim?
Simply create source file from this link & invoke SmartTag#SmartTag("debug").
when cursor is on "func()" call in main().
https://groups.google.com/d/msg/vim_dev/ceCVUq4eCxk/c7Gx7ukL_MUJ
Scott.
Try as I may, I cannot make Vim crash.
What version of Vim are you running?
--
Cheers,
Lech
> Try as I may, I cannot make Vim crash.
> What version of Vim are you running?
7.0.237 on CentOS 5.5.
Scott.
Try to compile a recent version and see, if it still crashes. We are now
at 7.3.353, which is more than 5 years after release 7.0
regards,
Christian
Good news. It doesn't crash with Vim 7.3.
I will try out Lech's tagfunc version soon. I would love to see this
get merged into mainline - is that likely to happen?
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
>