Skip to content

Suggestion: Improved Scopes for Inherited/Implemented/Extension Members #383

@fitdev

Description

@fitdev

It's very useful to limit the find symbol results for searches like Find Referrers/Overrides/Extensions to the following cases:

  • Current project only (perhaps have Shift modifier for this)
  • Current + Derived only
  • Current type only (for generic extensions) - hugely useful as an extension may be valid at 100s of places, but I am only interested in a few of them (closed generics) that use specific this type. (obviously it would have to be invoked from the caller, as the callee is an open generic).

And so with this approach these extra modifiers could be combined to further limit the scope.

The generics would be especially useful for enums for example, as I often search for common enum extension members I defined, but I need to find their usages on a specific enum, not all the usages on an open TEnum.

Also the existing implementation of current symbol only for Find Referrers does not work properly in that it finds too many items when Ctrl is used to limit results only to the current instance:

interface INameable { string Name { get; } }
abstract class NamedEntity  : INameable { 
  public string Name { get; set; }
}
class Country : NamedEntity { }
class Person : NamedEntity { }
class Program {
  void Main() {
    var c = new Country();
    c.Name = "Country";
    var p = new Person();
    p.Name = "John"; //<-- If I hover over Name here and choose Find Referrers with Match Symbol only, it will also find c.Name (the one on Country)
  }
}

It would be great if you could prioritize this, as this search is really indispensable for large solutions when you need to update/rename/refactor certain symbols and need to understand the specific places where they are used.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions