Author Topic: List current context is showing the wrong context in python file  (Read 125 times)

rowbearto

  • Senior Community Member
  • Posts: 815
  • Hero Points: 27
List current context is showing the wrong context in python file
« on: December 07, 2017, 08:07:15 pm »
I uploaded a file to support.slickedit.com under "list_current_context_wrong", the file name is: nelayout.py

Open nelayout.py in a clean config.

In BigFind, check "List all occurrences", "Match case", "Match whole word" and "List current context"

Search For: "ShelfNum" with all these options, as illustrated in the attached "searchSettings.png"

In the search results (searchResults.png attached file), line 290 is shown as being inside of the "startSim()" python function, when it is really inside of the readFromConfigFile() function.

I am using 22.0.0.9 patched version for memory leak built on October 17, 2017. I am on Linux x64 Centos 7.


rowbearto

  • Senior Community Member
  • Posts: 815
  • Hero Points: 27
Re: List current context is showing the wrong context in python file
« Reply #1 on: December 07, 2017, 08:15:52 pm »
A possibly related issue in this same file:

Go to line 295
BigFind, check: "Match case", "Match whole word", "List all occurences" and "List current Context"
choose "Look in: Current procedure"
search term: "slotTypePattern"
see attached screenshot "searchSettings2.png"

Line 314 should be in the search results, but it is not there.

EDIT: CORRECTION, line 295 should be in the search results, but it is not there. Line 314 is there, but line 295 is missing!

EDIT2: The search results depend on where the cursor is placed on line 295. If cursor is before the "slotTypePattern", then only line 295 shown in search results (and 314 missing). If cursor is after the "slotTypePattern", then only line 314 shown in search results, and line 295 missing.
« Last Edit: December 07, 2017, 08:38:29 pm by rowbearto »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1100
  • Hero Points: 94
Re: List current context is showing the wrong context in python file
« Reply #2 on: December 07, 2017, 09:22:23 pm »
Thanks for the report and the sample.  The second bug report I can confirm is already fixed in in Hotfix revision 11, there was a bug with List all and <Current Procedure> not working correctly.

The first one is a limitation in context handler for the search results. For line 290, the tagging engine reports the current context as a member variable instantiation for self.ShelfNum, which is correct.  Currently for search results, it only cares if the current context is function/procedure type and and isn't searching for outer contexts.  There are plans to expand current context feature for search results in a later release, but it is going to need a lot more work.  It is very limited at this time. 

Also, there needs to be a visual separator for when a specific function context ends, and the next item is in an unlisted context type (or global context).  In the first example, if you double-click to collapse the -/+ on the NELayout::Slot::startSim() function, you can see that only line 203 is grouped under that context.   There isn't a separator following it for the results on 290, and it looks like they are grouped when they shouldn't be.  That one I should be able to hotfix.

rowbearto

  • Senior Community Member
  • Posts: 815
  • Hero Points: 27
Re: List current context is showing the wrong context in python file
« Reply #3 on: December 07, 2017, 09:44:01 pm »
Thanks.

I just loaded hotfix 11 and the 2nd issue is still there.

Also also click the +/- on startSim, but I see a different result than you (see attached).

« Last Edit: December 07, 2017, 09:46:38 pm by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 815
  • Hero Points: 27
Re: List current context is showing the wrong context in python file
« Reply #4 on: December 09, 2017, 04:45:41 pm »
Both of these issues are also there with hotfix 13.