Author Topic: How to bind key for "Attempt to filter out non-matching function overloads"  (Read 738 times)

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
I find myself often toggling "Attempt to filter out non-matching function overloads" depending on what I want to do. For example, if I am adding a parameter to a function, I want it off so I can navigate between definition/prototype. But when I want to find a specific overload, I want it on.

Is there a way that I could bind a key/create a command to toggle this setting?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2791
  • Hero Points: 422
I will add the following command for beta4 that you can bind to a key.
This won't toggle the setting, it will just do a push-tag using the setting.

Code: [Select]
/**
 * The <b>push_tag_filter_overloads</b> command pushes a bookmark at the cursor
 * position and places the cursor on the source code (definition or declaration)
 * for the symbol under the cursor, attempting to filter out non-matching function
 * overloads.
 *
 * @param proc_name     encoded tag name to find.  See {@link tag_tree_compose_tag}.
 * 
 * @see push_tag
 * @see push_decl
 * @see make_tags
 * @see find_tag
 * @see bookmark_stack
 *
 * @appliesTo Edit_Window
 * @categories Search_Functions
 */
_command push_tag_filter_overloads(_str proc_name="") name_info(TAG_ARG','VSARG2_EDITORCTL|VSARG2_REQUIRES_MDI|VSARG2_REQUIRES_PRO_EDITION)
{
   return push_tag(proc_name,VSCODEHELPFLAG_FILTER_OVERLOADED_FUNCTIONS);
}
« Last Edit: August 30, 2018, 10:35:03 pm by Dennis »

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Thanks Dennis! That will be very useful

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: How to bind key for "Attempt to filter out non-matching function overloads"
« Reply #3 on: September 07, 2018, 04:09:58 am »
push_tag_filter_overloads() is working well for me. Thanks Dennis!

I bound it to key Alt-Shift-. , as it was free and similar to Ctrl+.

Perhaps using Alt-Shift-. should be the default key binding in SE for push_tag_filter_overloads() ?

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: How to bind key for "Attempt to filter out non-matching function overloads"
« Reply #4 on: September 07, 2018, 04:13:50 am »
So now the next layer of onion.

With push-tag/Ctrl-., if I press it once I go to the definition, and hit it a second time and it takes me to prototype.

Tried the same functionality with push-tag-filter-overloads()/Alt-Shift-., when I press it a 2nd time after being brought to my function definition, it does not bring me to the prototype, instead since cursor is at the beginning of the line it is showing me the definition of the return type of the function.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2791
  • Hero Points: 422
Re: How to bind key for "Attempt to filter out non-matching function overloads"
« Reply #5 on: September 07, 2018, 02:22:44 pm »
That can be done.  I'll put it in for the next build.

Not sure if I want to make it a default key binding though.