Author Topic: List Current Context  (Read 2330 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1658
  • Hero Points: 154
  • Text
List Current Context
« on: October 02, 2017, 07:06:14 pm »
List Current Context: Very nice feature!

In search results with contexts: Do FilterSearchResults.
When Filter removes all matches from a file, that file result line is also removed.
But, the context lines are not removed when all matches for that context are removed -- they should be.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: List Current Context
« Reply #1 on: October 02, 2017, 08:35:59 pm »
Confirmed.   I'll file a defect and work on a fix, should be hotfixable.

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 26
Re: List Current Context
« Reply #2 on: October 02, 2017, 09:24:34 pm »
I am observing another peculiar behavior related to this. As an example, if I do a search for "jitter" on a particular file, I get a window showing all of the occurrences of that term, with "jitter" highlighted. (See first screenshot.)

Next I do Filter Search Results and enter "jitterCount" as the search term. Only lines with "jitterCount" are shown, but instead of highlighting "jitterCount" SE still highlights "jitter". (See second screenshot.)

And if I do Filter Search Results again and choose "Remove duplicate lines", the duplicate of line 72 is removed, but the highlight is on the "jitter" in "jitterAvg" and not "jitterCount". (See third screenshot.)

Maybe this is the intended behavior, but intuitively I would expect the highlighting to change to "jitterCount" after I restrict the search.


Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: List Current Context
« Reply #3 on: October 03, 2017, 03:08:37 pm »
@davehohl:  Filter Search Results doesn't re-highlight any items in the results.  It is working as intended, though that could be a feature enhancement for a future release.

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #4 on: October 04, 2017, 07:50:55 pm »
When I use List current context to search in <Project> or <Workspace>, the search never completes (I have to stop it);

when I use List current context to search in <Current Buffer> or <All Buffers> the search completes ok (in a very reasonable time)... even when I have all the project's/workspace's files open.

« Last Edit: October 04, 2017, 07:52:47 pm by joecar »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: List Current Context
« Reply #5 on: October 04, 2017, 08:23:11 pm »
Is this Find in Files or is it a foreground search with List all occurrences?  I did a quick test and it is working for test projects I have.  How large is the workspace and is it populate with wildcards?

Using List current context does incur a performance penalty, it is a lot of IO going on with search and tagging lookups.

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #6 on: October 04, 2017, 09:35:08 pm »
Both foreground search and Find in Files, with list all occurrences.

Non-wildcard search string local to project, e.g. qla2x00_get_firmware_state

Project:
18 *.c and 15 *.h files
( linux device driver, qla2xxx, really not very big )

Workspace:
includes selected linux kernel include files (*.h), probably about 500 or so
( Goto Reference and Find Symbol complete very quickly, they don't have any problem )
( Find Symbol with Match Substring takes only a few seconds )

« Last Edit: October 04, 2017, 09:36:57 pm by joecar »

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #7 on: October 04, 2017, 09:45:18 pm »
When I have all the project's files open (i.e. 18 *.c and 15 *.h files), and I select <All Buffers> the problem does not happen, and the search completes in a very short time (even when the search string uses regex, and the matching strings appear almost everywhere, say 4500+ occurences).


The problem only happens when I select <Project> or <Workspace>.





joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #8 on: October 04, 2017, 09:49:14 pm »
Also, in the working cases, when I search for a struct member/field, the search result does not indicate any context (i.e. it does not say struct xxxx or union xxxx or enum xxxx)

( tol: what is the context when the struct/union is anonymous...? )

« Last Edit: October 04, 2017, 09:57:53 pm by joecar »

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #9 on: October 04, 2017, 09:50:47 pm »
( thinking out loud: what is the context of a #define...?  is it the containing .h file...? )

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #10 on: October 04, 2017, 09:55:46 pm »
BTW: the working cases also work quite well/quickly when color is selected (e.g. string/comment).

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: List Current Context
« Reply #11 on: October 05, 2017, 12:21:24 am »
Are you able to share the project and workspace files?  Probably don’t need the source files, but if you can upload the whole thing it might help.  Not sure what the issue could be.

This first release only supports listing matches inside function scope. Everything else is just file scope.  Future enhancements will include items in namespace and class/struct scope. 

joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #12 on: October 05, 2017, 12:52:26 am »
can I email it to you...?

( it's open source linux kernel stuff, but it might be easier to email it )

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1189
  • Hero Points: 114
Re: List Current Context
« Reply #13 on: October 05, 2017, 11:20:39 am »
https://support.slickedit.com/

There is an upload link, use Community-15683 for the case number and let me know when it's uploaded.


joecar

  • Senior Community Member
  • Posts: 208
  • Hero Points: 8
  • engineer/gearhead
Re: List Current Context
« Reply #14 on: October 05, 2017, 05:14:50 pm »
ok, uploaded;

thanks.