Skip to content

Disable move type when the options service isn't present#36334

Merged
ryzngard merged 5 commits intodotnet:masterfrom
ryzngard:issue/move_type_without_options
Jun 17, 2019
Merged

Disable move type when the options service isn't present#36334
ryzngard merged 5 commits intodotnet:masterfrom
ryzngard:issue/move_type_without_options

Conversation

@ryzngard
Copy link
Copy Markdown
Contributor

Fixes #35577

@ryzngard ryzngard requested a review from a team as a code owner June 11, 2019 21:49
int position,
CancellationToken cancellationToken)
{
var moveToNamespaceOptionsService = document.Project.Solution.Workspace.Services.GetService<IMoveToNamespaceOptionsService>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❔ Why not in GetCodeActionsAsync?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just preference

Copy link
Copy Markdown
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sharwell
Copy link
Copy Markdown
Contributor

💡 Consider moving the dependency further up into the [ImportingConstructor] of the CodeRefactoringProvider. This will prevent the refactoring from ever getting instantiated in VS for Mac and eliminate the need to do a service check each time it's used.

@ryzngard
Copy link
Copy Markdown
Contributor Author

@sharwell I think I have the MEF requirements correct now. This still can't checked in until I find out what's going on with OOP MEF stuff. I'm following up with @heejaechang for that

@ryzngard
Copy link
Copy Markdown
Contributor Author

Part rejection is not enabled, so I used AllowDefault = true and did a null check myself. Filed #36396 to follow up on enabling this for Roslyn OOP if we want to.

namespace Microsoft.CodeAnalysis.Test.Utilities.MoveToNamespace
{
[ExportWorkspaceService(typeof(IMoveToNamespaceOptionsService)), Shared]
[Export(typeof(IMoveToNamespaceOptionsService)), Shared]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Parts defined in test assemblies need [PartNotDiscoverable]

@ryzngard ryzngard merged commit d4afaea into dotnet:master Jun 17, 2019
@jinujoseph jinujoseph added this to the 16.2.P4 milestone Jun 17, 2019
333fred added a commit to 333fred/roslyn that referenced this pull request Jun 18, 2019
…-types

* dotnet/master: (63 commits)
  Fix stack overflow in requesting syntax directives (dotnet#36347)
  crash on ClassifyUpdate for EventFields (dotnet#35962)
  Disable move type when the options service isn't present (dotnet#36334)
  Fix crash where type inference doing method inference needs to drop nullability
  Fix parsing bug in invalid using statements (dotnet#36428)
  Do not suggest or diagnose use compound assignment when right hand of binary operator is a throw expression
  Add option to emit nullable metadata for public members only (dotnet#36398)
  Added null checks on F# external access services (dotnet#36469)
  Deal with discovering extra .editorconfig files
  Re-enable MSBuildWorkspaceTests.TestEditorConfigDiscovery
  Add support to VisualStudioMSBuildInstalled to support minimum versions
  Fix configuration of accessibilities in editorconfig
  Shorten a resource ID
  Revert "Extract the RDT implementation for Misc files and VS open file tracker"
  Add nullability support to use local function
  Add EditorFeatures.WPF dependency to F# ExternalAccess
  Ensure NullableWalker.AsMemberOfType locates the right new container for the member. (dotnet#36406)
  Replace `dynamic` with `object` when substituting constraints. (dotnet#36379)
  Add some string descriptions
  Adjust type of out var based on parameter state (dotnet#36284)
  ...
333fred added a commit to 333fred/roslyn that referenced this pull request Jun 20, 2019
* dotnet/master: (85 commits)
  Don't complete statement when typing semicolon inside comments in an argument list (dotnet#36521)
  Set focus to editor before finding text
  Add a bunch of nullability support to some code generation helpers
  Add 'annotations' and 'warnings' support to nullable directive (dotnet#36464)
  Fixed IDE services touching `notnull` constraint (dotnet#36508)
  Update compiler toolset to arcade version (dotnet#36549)
  Fix for 923157
  Do not include value types in NullableAttribute byte[] (dotnet#36519)
  Fix a deadlock in InvokeOnUIThread
  Apply a hang mitigating timeout to UI thread operations
  Move to a different lowering from for nullable value types to work around a bug in TransformCompoundAssignmentLHS. Addressed PR feedback.
  Fix stack overflow in requesting syntax directives (dotnet#36347)
  crash on ClassifyUpdate for EventFields (dotnet#35962)
  fixing bad merge with refactoring that was checked in later
  added basic completion statement telemetry
  Remove duplication in AbstractSymbolCompletionProvider.CreateItems
  Disable move type when the options service isn't present (dotnet#36334)
  Fix crash where type inference doing method inference needs to drop nullability
  Revert "Use IVsSolution to look up IVsHierarchy by project GUID (dotnet#35746)"
  Fix parsing bug in invalid using statements (dotnet#36428)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to namespace not supported on Visual Studio for Mac

5 participants