Skip to content

OverrideCompletionProvider should allow items to be added  #36060

@avodovnik

Description

@avodovnik

Version Used: 3.1.0-beta4-19261-04

Visual Studio for Mac has a special behaviour that is specific to the way Xamarin/AppKit works. We offer the user "overrides" where they actually aren't overrides but protocol member implementations (note: this is also not an interface implementation but an Objective-C specific):

image

Picking AddObserver in the list above, would result in the following code being added:

[Export("addObserver:forKeyPath:options:context:")]
public void AddObserver(NSObject observer, NSString keyPath, NSKeyValueObservingOptions options, IntPtr context)
{
    throw new System.NotImplementedException();
}

Recently, when moving away from our old implementation of how we surface completion items, we discovered that we can no longer add items to the override list. The assumption is that this and this are the culprits.

We're happy to contribute the required change, but feel like it should be discussed first, to make sure we take the right approach. Here are some of the possible ones:

  1. Add a way to register completion providers in a way where we un-register the existing one. That way we could derive from OverrideCompletionProvider and extend it with our required logic.
  2. Enable OverrideCompletionProvider to also call down to another set of MEF-provided providers, to retrieve additional items.
  3. Change this to take all contexts that had IsExclusive set to true. Potentially, there could be more metadata on the provider itself (i.e. a Tag) and we'd group exclusivity by the same tag as well).

Are we missing something obvious? Is any of the above options something that would be acceptable to PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Complete

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions