Author Topic: Symbol completion problems  (Read 7598 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Symbol completion problems
« on: January 13, 2007, 11:25:26 PM »
1)  I have this code fragment:
Code: [Select]
            NMHDR nmhdr = lpnmitem->hdr;
           
            //------------------------------------------------------------------
            //    TODO: 
            //------------------------------------------------------------------
            switch (nmhdr) {
            }
If I put the cursor on 'NMHDR' and press ctrl-., I am taken to the definition for NMHDR.  When I put my cursor immediately after 'nmhdr' and type '.', I get nothing.  If I add 'co' and press ctrl-space, I get the message "No symbols found matching 'co'".

2)  Even when SE musters the will to display the list of symbols, it no longer scrolls to a matching symbol as I type.  Perhaps this is a tagging option of some sort, but I don't recall having changed them recently.

WinXP sp2, SlickEdit 11.0.2

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Symbol completion problems
« Reply #1 on: January 14, 2007, 12:08:35 AM »
1)  I have this code fragment:
Code: [Select]
            NMHDR nmhdr = lpnmitem->hdr;
           
            //------------------------------------------------------------------
            //    TODO: 
            //------------------------------------------------------------------
            switch (nmhdr) {
            }
If I put the cursor on 'NMHDR' and press ctrl-., I am taken to the definition for NMHDR.  When I put my cursor immediately after 'nmhdr' and type '.', I get nothing.  If I add 'co' and press ctrl-space, I get the message "No symbols found matching 'co'".

2)  Even when SE musters the will to display the list of symbols, it no longer scrolls to a matching symbol as I type.  Perhaps this is a tagging option of some sort, but I don't recall having changed them recently.

WinXP sp2, SlickEdit 11.0.2

Regarding symbols not updating - see this thread - maybe deleting vslick.sta will help the Ctrl-space problem too - don't forget to backup you config folder first if you try it.
http://community.slickedit.com/index.php?topic=785.0

Possibly restarting slick might help but I guess you tried that.
Graeme





Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Symbol completion problems
« Reply #2 on: January 14, 2007, 02:58:38 AM »
Quote
Regarding symbols not updating - see this thread - maybe deleting vslick.sta will help the Ctrl-space problem too - don't forget to backup you config folder first if you try it.
http://community.slickedit.com/index.php?topic=785.0

Thanks for the reply. 
Unfortunately, it seems "delete vslick.sta" is increasingly the recommended repair, and increasingly less acceptable.  When I close SlickEdit, delete vslick.sta, and restart, I'm greeted with: messages about not being able to load a couple of macro files; the Welcome screen; the dialog prompting me to tag the various libraries; and finally my keyboard layout choice.
Am I the only one that thinks that something is going awry when you need to delete (in my case) 7 meg. of state information in the _hope_ that it will solve a problem?

In any case, it didn't solve the problem.  I even re-tagged my entire project (only 480 files), and that didn't work.

Perhaps the problem lies in the fact that NMHDR is defined in two source files (RichEdit.h and WinUser.h)? 

And then there are symbols such as LVITEM.  It has the same problem as NMHDR.  I can almost understand the problem with LVITEM, since it resolves to different things based on both Windows version and the UNICODE flag, but NMHDR depends on nothing.

Very frustrating.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Symbol completion problems
« Reply #3 on: January 14, 2007, 08:25:22 AM »
Quote
Unfortunately, it seems "delete vslick.sta" is increasingly the recommended repair, and increasingly less acceptable.  When I close SlickEdit, delete vslick.sta, and restart, I'm greeted with: messages about not being able to load a couple of macro files; the Welcome screen; the dialog prompting me to tag the various libraries; and finally my keyboard layout choice.

Well, I don't know about increasingly.  I suggested it to someone whose symbol table wasn't updating and it solved the problem for him, (and I think he was glad to have his problem solved) so I suggested it to you and took care to remind you to backup your config folder first.  I also suggested it in the recent thread about the titlebar when the code that you posted, surprisingly hung his system.  My comment on this would be that the ability to customise SlickEdit is useful much more often than not and there's occasionally a small price to pay. 

One of the reasons I'm so interested in the issue of transferring configuration info etc. is to be able to recover quickly if anything goes wrong on my system.

Quote
Am I the only one that thinks that something is going awry when you need to delete (in my case) 7 meg. of state information in the _hope_ that it will solve a problem?

Nope, not the only one at all.  It's an ugly solution for sure but I can only recall one other person on this forum suggesting to delete vslick.sta besides me and that was Clark (which is where I first got the idea), however, often I suggest to try a new config folder, which is a similar thing but mostly I suggest it to try and track down a "configuration setting" problem rather than to recover from a "lost symbols window update".  Complex software inevitably has bugs and Slick has been in development for 15 or 20 years or something so I think it's fair to call it complex and I suspect the number of "semi-catostrophic failures" like symbol windows not updating is probably small.

Probably I should have thought to ask you if the symbol window was never updating at all or only for specific symbols.  It it was never updating at all, I'm surprised that deleting vslick.sta didn't fix it.  Ideally I'd like slick-team to document the "delete vslick.sta solution" so people know what to expect when they do it, and what they lose.

I can understand your frustration at having to spend non-productive time trying to get your editor working.

Regarding NMHDR, it seems your guess about the two definitions being the problem is correct.  In the code below, completion fails for the code as written  - but it works (i.e. the drop-down list of symbols appears) if "struct _nmhdr2" is changed to "struct _nmhdr" i.e. if both struct tagnames are the same.  In windows headers, the struct tagnames are _nmhdr and tagNMHDR i.e. they are different, yet are typedef'd to the same name NMHDR.  As we all know, C++ is complex and tagging it must be complex also, so IMO it's not at all surprising there's sometimes problems.

Good luck.

Code: [Select]
#ifndef abcd
#define abcd
typedef struct _nmhdr
{
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR;
#endif

#ifndef abcde
#define abcde
typedef struct _nmhdr2
{
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR;
#endif

int main()
{
    NMHDR nm;
    nm.
}

Regards
Graeme
« Last Edit: January 14, 2007, 09:30:41 AM by Graeme »

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Symbol completion problems
« Reply #4 on: January 14, 2007, 12:33:04 PM »
Thanks for the reply, Graeme. 
SlickEdit generally works so well, problems like these are frustrating.  (And frustration is probably proportional to hours worked, and inversely proportional to time remaining to milestone...)

Instead of "No symbols found matching 'co'", an error message something like "NMHDR is ambigous, unable to show members" would be more helpful.  (If I customarily kept the Symbol window visible, I might have noticed that sooner, too.)  Even better, a message along the lines of "NMHDR matches _nmhdr and tagNMHDR, unable to resolve". 

As for LVITEM, it was shown in the Symbol window as
Code: [Select]
#ifdef UNICODE
#define LVITEM    LVITEMW
#define LPLVITEM  LPLVITEMW
#define LVITEM_V1_SIZE LVITEMW_V1_SIZE
#else
#define LVITEM    LVITEMA
#define LPLVITEM  LPLVITEMA
#define LVITEM_V1_SIZE LVITEMA_V1_SIZE
#endif

What wasn't happening was the resolution of LVITEMA.  After adding a preprocessor token (Tag Files->Options->C Preprocessing...), it works as desired.  As above, a clearer error message would be helpful.  "LVITEM could be LV_ITEMA, or tagLVITEMA..." or "Multiple definitions available for LVITEMA".

Quote
Ideally I'd like slick-team to document the "delete vslick.sta solution" so people know what to expect when they do it, and what they lose.
That would be very helpful. 
If you:
   copy ...\My SlickEdit Config\11.0.2 to ...\My SlickEdit Config\11.0.2.LNG
   delete ...\My SlickEdit Config\11.0.2\vslick.sta
   restart SlickEdit
Perhaps the SlickEdit team could document what was lost?  What can you recover from 11.0.2.LNG? 
Similarly, when you start the editor with an empty config dir, what can you recover from your backup copy?

Quote
One of the reasons I'm so interested in the issue of transferring configuration info etc. is to be able to recover quickly if anything goes wrong on my system.
In addition to that, I'd like to know which files I need to take from one computer to another to have the same settings on my computer at home, and my computer at work.  Perhaps a set of files could be identified that could go into SCC to enable sharing settings, as well as be able to revert to a previous state when a problem occurs. 



Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Symbol completion problems
« Reply #5 on: January 16, 2007, 06:22:04 PM »
Well now.  I discovered a problem with "Highlight matching blocks" -- when scrolling, and the cursor gets to a #ifdef, I often get two "Recursion too deep" messages, along with two stack trace windows.  Highlight matching stops working at that point.

Another thing that stops working: highlighting mactching symbols in the symbol completion feature.  See the attached screen shot.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Symbol completion problems
« Reply #6 on: January 16, 2007, 08:07:30 PM »
Can't say anything about the 'Recursion too deep' problem, but codehelp e.g. 'auto-list members' works fine (in v11.02 + hotfixes)...
Or do you mean that it stops working _after_ the 'Recursion too deep' stack dump ?

HS2

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Symbol completion problems
« Reply #7 on: January 16, 2007, 08:59:25 PM »
Or do you mean that it stops working _after_ the 'Recursion too deep' stack dump ?
That's what I mean.  Completely reproducible on my setup.  I've contacted tech support.