Roslyn: Allow public use of CodeActionWithNestedActions

Created on 6 Jun 2017  路  11Comments  路  Source: dotnet/roslyn

Version Used: Current master

Steps to Reproduce:

  1. Try to instantiate CodeActionWithNestedActions
  2. Nope, internal
  3. 馃槩

Expected Behavior: Should be able to create CodeActionWithNestedActions through either some other overload to Create or with new

Actual Behavior: Can't create "grouped" refactorings because there's no public way to create an instance of that class

/cc @CyrusNajmabadi

Area-IDE Concept-API Feature Request Resolution-Fixed

Most helpful comment

Solution: Just give IVT to ryan. (note: not typescript. just ryan).

All 11 comments

I'm okay with opening this up for 15.6. @CyrusNajmabadi @DustinCampbell @kuhlenh any objections?

@RyanCavanaugh PS - we take PRs 馃槈

No objections from me since I had to resort to reflection in OmniSharp to properly support code actions. Without exposing this, Roslyn API consumers and code fix authors are at a disadvantage.

We shoudl def make this available. Though i think teh correct way to do this is to just allow CodeAction to have nested children (that's actually how the property is exposed). I dont' think there's a need for a distinct subtype.

Also, we have to decide how we want to expose the "can my children be flattened directly into the lightbulb if there aren't that many items?" flexibility that we currently have.

Solution: Just give IVT to ryan. (note: not typescript. just ryan).

:smile:

Prioritizing this on the grounds that IDE analyzers shall not have special privileges. We either need to expose this functionality, or remove uses of this functionality within dotnet/roslyn.

It's less of an objection and more like: the API here is really ugly. We shouldn't expose CodeActionWithNestedActions. it should just be that any CodeACtion can have nested children :)

I'm thinking a new overload of CodeAction.Create:

public static CodeAction Create(
    string title,
    ImmutableArray<CodeAction> nestedActions,
    bool isInlinable)

I think that's reasonable.

馃帀

Was this page helpful?
0 / 5 - 0 ratings