Author Topic: 'tags.e - current_tag()' ignores 'include_args' parameter  (Read 7514 times)

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
'tags.e - current_tag()' ignores 'include_args' parameter
« on: August 11, 2007, 05:10:50 PM »
@SlickTeam: I think adding this parameter to the public interface was/is a good idea.
Would be nice if the parameter gets really used there ;)
Thanks,
HS2

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #1 on: August 15, 2007, 08:18:08 PM »
This will be fixed in v13, however, as you might notice, we don't use current_tag() very much anymore, it's sort of a legacy function.  Generally, the modern way is to use tag_current_context() and tag_get_context_info() to get the data about the current symbol under the cursor.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #2 on: August 15, 2007, 08:38:42 PM »
Thanks Dennis !
Right - the new API is much more powerful and I already used somewhere else.
BTW: Is there a rule when to _UpdateContext first ? Since I had some problems with the context being not in sync I'm using it probably way too often now. Is it expensive to use it ? I had the impression that's it's quite fast...
However, If there is a bit more time I'll convert my legacy stuff using legacy API to the new interfaces...

HS2

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #3 on: August 15, 2007, 08:46:41 PM »
_UpdateContext() will force the entire file to be parsed (which really doesn't take that long) when the tagging information is out of date, but if it is already cached, _UpdateContext() is nearly instantaneous.

For example:

Code: [Select]
_UpdateContext(true);
_UpdateContext(true);
_UpdateContext(true);
_UpdateContext(true);
_UpdateContext(true);
_UpdateContext(true);

is for all practical purposes just as fast as:

Code: [Select]
_UpdateContext(true);

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #4 on: August 15, 2007, 09:03:59 PM »
Ah - thanks. I assume that 'out-of-date' doesn't mean that just the file date is considered by the caching strategy.
In other words it also takes care about modified buffers (flagged by p_LastModified ?), right ?
HS2

Dennis

  • Senior Community Member
  • Posts: 3992
  • Hero Points: 520
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #5 on: August 15, 2007, 09:13:36 PM »
Yes, p_LastModified calls all the shots.  _UpdateContext() doesn't care about the file date, just whether the file's contents have or have not been modified since the last time _UpdateContext() was called.

In earlier versions of SlickEdit (v11 and lower), there was just one "context", so when you flipped between buffers, SlickEdit frequently reparsed files.  In v12, we have a working set of "contexts" corresponding to the most recently used files.  I chose to use a working set strategy instead of simply using one "context" per open file because (a) I don't have to track open files, (b) it limits memory consumption, and (c) the cache still works when you close a file and re-open it (references frequently does this when it is doing symbol analysis).  It really was a significant performance improvement, but nobody really noticed.

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #6 on: August 15, 2007, 09:27:49 PM »
Quote
It really was a significant performance improvement, but nobody really noticed.

Aw Dennis, don't you think we all appreciate your talents???  We do!!! :-)

John Hurst
Wellington, New Zealand

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: 'tags.e - current_tag()' ignores 'include_args' parameter
« Reply #7 on: August 15, 2007, 09:45:07 PM »
C'mon Dennis - I already told that a number of times :)
last time: 06-07-2007, 19:32:44: v12.02 announcement:
Quote
(I also had the impression that v12.02 is again a bit faster.)

In fact I still can't believe it that while really sophisticated features were added in the past, the speed is still at an astonishing high level. Some (improved) features are even faster now. So keep up the good work !

HS2