Author Topic: Multiple symbol definitions in "Symbol" window  (Read 8062 times)

ahacali

  • Community Member
  • Posts: 24
  • Hero Points: 2
Multiple symbol definitions in "Symbol" window
« on: October 24, 2006, 07:08:39 pm »
Hello,

Sometimes, in the "Symbol" window, I get multipled listings (defintion of symbol).  Is there some action I can take, so I can select one of them and make it expand in the Symbol window, rather than have to double-click on an it and make it appear on main window.

This is what I would like to do.  When muliple listing show up in "Symbol" window, and I know which is the correct one, I would like to be able to expand that item into Symbol window, rather than change my main window.  And that way, I wil main my main code on main window, and the symbol definition on "Symbol" wondow.

Regards,
Aha.

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
Re: Multiple symbol definitions in "Symbol" window
« Reply #1 on: October 24, 2006, 09:28:14 pm »
If you simply left click it one time, does that not display it in the symbol window?  Oh...  We might be talking about two different windows.  I use the references Preview Pane.  When I left click a reference, the code appears in the Preview Pane without moving the edit location in the source window.  I thought that's what you meant.  I don't use the Symbol window except as a shortcut to the Tag Files dialog.   :D

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: Multiple symbol definitions in "Symbol" window
« Reply #2 on: October 24, 2006, 09:43:59 pm »
You can use 'Alt-.' to select the 'right' symbol preview.

HS2

ahacali

  • Community Member
  • Posts: 24
  • Hero Points: 2
Re: Multiple symbol definitions in "Symbol" window
« Reply #3 on: October 24, 2006, 10:12:10 pm »
Hello,

Phil Barila: 

You are right, I am talking about the "Symbol" pane window, and you are referring to the "Reference" pane window.  Actualy, if the "Symbol" pane widow did something like the "Referece" pane window, that would be nice.  Or if I could place the mouse on top of an item in the "Symbol" window, and that item got expanded. :)

HS2:

The concept of a "right" symbol does not apply here.  Imagine there are multiple definitions of a function - foo().  In the edit window, when one places the cursor on "foo", all the definitions appear in the "Symbol" window, and they are all "correct" as far as the editor is concerned.  Only after they appear, then one can choose to see a specific one "expanded" and shown fully in the "Symbol" window.  I hope that clarifies my request / question in my first email.

Regards,
Aha.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: Multiple symbol definitions in "Symbol" window
« Reply #4 on: October 24, 2006, 10:20:53 pm »
Yes - that's understood...
But after 'Alt-.' you can select the symbol preview you want to see (the 'right' symbol or the symbol you are interested in).
Click on the blue <- and -> arrows which are displayed on ambiguous symbols.

HS2

ahacali

  • Community Member
  • Posts: 24
  • Hero Points: 2
Re: Multiple symbol definitions in "Symbol" window
« Reply #5 on: October 24, 2006, 10:49:26 pm »
Got it, thank you for you response.  I see how I can achieve my goal.

However, a suggestion to the SlickeEdit Team, it would be nice (and easier), if a user could just "click" on a specific item from Symbol window, and allow it to expand in the "Symbol" window.   Heck, even better, make it behave like the "Reference window".  If one symbol definition found, behave as now. If multiple definition found, split "Symbol" window into two.  :)

Anyone know where one can post feature request for SlickEdit.

Regards,
Aha.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: Multiple symbol definitions in "Symbol" window
« Reply #6 on: October 24, 2006, 10:55:05 pm »
Good proposal ahacali !
I think the right place to post and to discuss feature requests is right here.
You know - not all ideas are appreciated by all others...
But that's the benefit of actively participating here - you can influence the SlickEdit evolution !

HS2

at5dapa1

  • Senior Community Member
  • Posts: 170
  • Hero Points: 16
Re: Multiple symbol definitions in "Symbol" window
« Reply #7 on: October 25, 2006, 07:52:13 am »
Maybe will be a little help, if you set some filters for the Symbol window (right-click in that window).
For example, I deselect Scope->Extern and Function->Prototype, in this way I don't see the declaration of vars/methods, but only the definition.
But this doesn't help if you have 2 functions with same name, or 2 defines with same name.

Another thing which can help is to set correct compiler switches (#defs/#undefs) in the Tools->Options->Tagging Options->C Preprocessing. This will make SlickEdit happier, by not parsing the dead code.

One thing which can help is to select "Go to Definition" and to use Ding Zhaojie's super-patch: http://community.slickedit.com/index.php?topic=470.0. Will appear the dialog "Select a tag" where you can navigate and you'll see the preview in Symbol window. Not necessary to go to definition, just preview it, press ESC and come back to your code!  ;)

Daniel

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: Multiple symbol definitions in "Symbol" window
« Reply #8 on: October 25, 2006, 12:16:28 pm »
for review:  I've been asking for some time (years, really) for the tagging/symbol to match, at least, on argument/parameter count.  It would be best to match not only number, but type.  Such would 99.44% of the time find just one match.  I don't recall any timeline for when (if?, IIRC it was said to be on the list) we would see it.

Ding Zhaojie

  • Senior Community Member
  • Posts: 193
  • Hero Points: 37
Re: Multiple symbol definitions in "Symbol" window
« Reply #9 on: October 25, 2006, 12:38:09 pm »
I don't like the symbol opens in buffer when I dbl-clk one of the multiple tags. I think the ideal way to view the multiple tags is alike the Reference window: list the tags in a separate list and view them in a preview area.

I modified the tagwin.e a little: It opens the symbol just in the symbol window but not open it in a new buffer (If you want to do so, dbl-clk it again).

It is not perfect, but sometimes useful.

Follow this to apply the patch:
1. backup your tagwin.e
2. Open tagwin.e, find tagwin_mode_enter()
3. change it like this (I marked my modifications with comments):
Code: [Select]
static void tagwin_mode_enter()
{
   if (p_buf_name==TAG_WINDOW_BUFFER) {
      _str line;
      get_line(line);
      if (substr(line,1,11)=='Maximum of ') return;
      if (line!='') {
         /**
          * Modified by Ding Zhaojie
          * Show symbol in tagwin but not jump to it
          */
         struct VS_TAG_BROWSE_INFO cm;
         typeless lineno;
         parse line with cm.type_name "\t" cm.member_name "\t" cm.file_name ":" lineno;
         cm.flags = 0;
         cm.class_name = '';
         cm.line_no = lineno;
         cb_refresh_output_tab(cm, 1);
      }
   }else{
      tagwin_goto_tag(p_buf_name, p_RLine);
   }
}
4. reload tagwin.e, enjoy.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: Multiple symbol definitions in "Symbol" window
« Reply #10 on: October 26, 2006, 08:34:44 am »
@Ding: You are a hero !

You may also 'hook' the event when selecting one of the ambiguous symbols:
With that you can use the normal functionality still in no-mouse mode ;)
I renamed the original tagwin_mode_enter() to tagwin_mode_enter_org().
But of course you can add some other events executing the proper macro.

change tagwin.e - edit1.\0-ON_SELECT():
Code: [Select]
   if (upcase(eventname)=='LBUTTON-DOUBLE-CLICK') {
      tagwin_mode_enter();
      return;
   }
to e.g.:
Code: [Select]
   eventname = upcase(eventname);
   if (eventname=='LBUTTON-DOUBLE-CLICK' || eventname=='C-ENTER') {
      tagwin_mode_enter_org();
      return;
   }
   if (eventname=='ENTER') {
      tagwin_mode_enter();
      return;
   }

HS2
« Last Edit: October 26, 2006, 08:36:19 am by hs2 »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4809
  • Hero Points: 390
Re: Multiple symbol definitions in "Symbol" window
« Reply #11 on: October 28, 2006, 12:12:31 am »
If what I'm seeing for V12 right now stays, there will be a new Find Symbol tool window in V12.  The contents will be viewed in a separate tool window (not sure what the name will be).  This should make everyone happy :-)

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
Re: Multiple symbol definitions in "Symbol" window
« Reply #12 on: October 28, 2006, 08:30:57 pm »
There are more and more signs that v12 will be another great and innovative release !
Looking fwd to the beta,

HS2