[go: up one dir, main page]

Menu

#2 Tag selection

Unknown
open
nobody
None
5
2015-03-21
2014-11-11
No

Copied from forums: https://sourceforge.net/p/joe-editor/discussion/74214/thread/097cdfaf/

Hi joe users,

I know this feature has been requested multiple times by several people.

For my current project it is an issue for which I don't have a workaround, besides using another editor that supports tag selection. I would like to implement it myself, but the source code is poorly documented. :(

If some expert (Joe?) could give me a few hints to get started quickly, it would be sincerely appreciated.

The request is to support selection of a non-unique tag. This is especially important in a C++ context where the same member function name occurs in multiple classes. Right now, JOE's tag selection mechanisms always picks the first occurrence of the tag in the tags file. That's in many cases not the proper tag, so a selection mechanism is required here to let the user select the correct tag.

For minimum coding effort I propose to use the same functionality that is already available for string completion using the sequence ESC-Enter, ESC-Enter. That is, the presentation of alternatives in an interactive list. I propose to supply one entry per tag alternative containing the tag string between '/^' and '$/;"'. If possible, the containing file name should be prepended.

For the proposed implementation, I would like to know which sequence of commands is needed to create such a selection list. Any suggestions/improvements regarding the proposed implementation or functional extension are appreciated.

Thanks,

Achie

Discussion

  • Joe Allen

    Joe Allen - 2015-03-16

    Tags file can have this:

    first foo.h 2
    first::my_member foo.h /^int first::my_member(int a)$/
    first::my_member foo.h /^int first::my_member(double a)$/
    second foo.h 7
    second::my_member foo.h /^int second::my_member(int z)$/

    Maybe it should find all occurances of my_member, not just first::my_member.

     
  • Joe Allen

    Joe Allen - 2015-03-20

    This is now implemented in Mercurial for Joe-4.0. Hit ^K ; to find the first match. Hit ^K ; again to cycle through the rest. Also it allows you to search for the member name without the class prefix.

     

    Last edit: Joe Allen 2015-03-20
  • Joe Allen

    Joe Allen - 2015-03-21

    Well I switched it to a menu of matching searches- it does work better. If you are unhappy with the selection, hit ^K ; a second time to re-enter the menu.

    Also I've added an option "notagsmenu" to disable the menu. Without this, you have to repeatedly hit ^K ; to find the match you want.

    Some version of ctags include comments along with each entry. I tried including these in the menu entries, but they are not as useful as the file name and search string so I took it out.

     
  • John J. Jordan

    John J. Jordan - 2015-03-21

    Might be worth posting this in the discussion group linked :-). Also I think this is invisible? at least to anonymous users.

     

Log in to post a comment.