Author Topic: Context Tagging question  (Read 5555 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Context Tagging question
« on: August 06, 2009, 06:08:39 PM »
SlickEdit Version 14.0.2.2   Build Date: July 08, 2009   Emulation: Vim

OS: Windows XP    Version: 5.01.2600  Service Pack 3
Hotfixes:
C:\Documents and Settings\CB\My Documents\My SlickEdit Config\14.0.2\hotfixes\hotfix_loader_se1402.zip (Revision: 1)
C:\Documents and Settings\CB\My Documents\My SlickEdit Config\14.0.2\hotfixes\hotfix_se1402_cumulative.zip (Revision: 11)

I have a VisStudio solution (.sln) open; it has several Visual C++ (.vcproj) and C# (.csproj) projects.

Search->Find Symbol...         <Use Context Tagging>  Match case/substring/pattern UNChecked
When I search for WS_CHILD, I get 4 references to .Net dlls, but no references to the .h files the symbol is defined in.
Why is that?

When I go to the Create Tag Files for Compiler Libraries, click the Configure button for the Visual Studio 2008 entry, all the directories with the appropriate header files are listed.



Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Context Tagging question
« Reply #1 on: August 06, 2009, 07:33:39 PM »
"<Use Context Tagging>" is dependent on the current file.  I'm guessing your current file is a C# source file (since it's searching .NET DLL's).  If the current file were C++, it would then select the C++ tag file.

It also depends on the current compiler tag file.  If your current project is one of the .csproj (C# projects), then your compiler tag file will be the C# tag file, not the C++ compiler tag file.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Context Tagging question
« Reply #2 on: August 06, 2009, 10:33:59 PM »
That makes sense, sort of...
The workspace has 2 .csproj files, and 4 .vcproj files.

1)  Current project is a .vcproj.  Current file is .cpp.  Search for GWL_STYLE correctly returns the .h files.

2)  Close all buffers.  Current project is still .vcproj.  Search for WS_CHILD.  Only .dlls are returned.

3)  Close all buffers.  Current project is still .vcproj.  Set "Look in:" to <All Tag Files>.  Search for WS_CHILD; only .dlls are returned.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Context Tagging question
« Reply #3 on: August 07, 2009, 02:51:04 PM »
Couple more questions...

1)  How do you use regular expressions?  I have "Use Pattern" checked, "Regular Expression (SlickEdit)" selected.
According to the help:
Code: [Select]
\b
Matches at word boundary. For example, \bre matches all occurrences of "re" that only occur at the beginning of a word.

Unfortunately, "\bPOINT" matches nothing.  (Context Tagging, .vcproj file, the .h file containing the definition for POINT is loaded...)

2)  Is there a way to "match entire word"?

Thanks for any help...

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Context Tagging question
« Reply #4 on: August 07, 2009, 03:22:26 PM »
\b doesn't really make much sense there, by default the symbols should be prefix matched, unless you're using match substring option there.  Using ^ (begin string/line anchor) would be more appropriate, but you should turn off match substring if you want the prefix matched anyway.  I will have to double-check \b option there, in theory that should have worked.
 
You can try ^POINT$ ($ = end of string/line anchor) for matching entire word.

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
Re: Context Tagging question
« Reply #5 on: August 07, 2009, 03:25:10 PM »
"<All Tag Files>" probably only includes the workspace tag file and Language specific tag files, not compiler tag files.  I will file a bug w.r.t to this.  It should include the current default compiler tag file.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Context Tagging question
« Reply #6 on: August 07, 2009, 03:44:38 PM »
Thanks for the replies...

Lee:
I was surprised that ^/$ match begin/end of string, not just line, in the Find Symbol window.  That is not how those characters behave in an edit buffer, or in the Find and Replace dialog.
...Unless 'line', in the Find Symbols window, means the line a symbol is listed on... Then ^POINT$ makes sense, since it is the only item on the line it is displayed on.  (I was thinking in terms of the file where it is defined, where 'POINT' is neither the first nor last word on the line it appears on.)

Dennis:
From the Help:
<All Tag Files> - Select this setting to search all tag files for all languages.
I understand now, as explained above, that <Context Tagging> is related to current workspace/project.