Is there any way to add design time metadata to Visual Studio that would suggest a string parameter should correspond to the name of a controller or view? MVC already has this type of intellisense when authoring
I have some custom Html Helper Extensions that take in Controllers and Views by name and would love the syntax highlighting / autocomplete support that is available to native methods like Controller.View
or Url.Action
. Here's a trivial example:
public static string IsActiveClass(this HtmlHelper html, string action, string controller)
{
return IsActiveBool(html, action, controller) ? "active" : "";
}
And here's a side by side of the native intellisense compared to custom methods which are just treated like a string:
Obviously, this could be checked at runtime via reflection, but I'd like to see if there's anyway to identify it at design time. Another answerable question might be how is Visual Studio currently performing this (especially as a way to identify if it's possible to tap into that process)