未验证 提交 54be1d6c 编写于 作者: A Andrew Hall 提交者: GitHub

Merge pull request #38920 from ryzngard/feature/remove_inline_rename_experiment

Remove experimentation for file rename with inline rename
......@@ -156,10 +156,7 @@ private set
_debuggingWorkspaceService = workspace.Services.GetService<IDebuggingWorkspaceService>();
_debuggingWorkspaceService.BeforeDebuggingStateChanged += OnBeforeDebuggingStateChanged;
var experimentationService = workspace.Services.GetRequiredService<IExperimentationService>();
if (experimentationService.IsExperimentEnabled(WellKnownExperimentNames.RoslynInlineRenameFile)
&& _renameInfo is IInlineRenameInfoWithFileRename renameInfoWithFileRename)
if (_renameInfo is IInlineRenameInfoWithFileRename renameInfoWithFileRename)
{
FileRenameInfo = renameInfoWithFileRename.GetFileRenameInfo();
}
......
......@@ -1789,158 +1789,6 @@ End Class
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyNoFileRenameAllowedForPartialTypeDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
partial class [|$$Goo|]
{
void Blah()
{
}
}
</Document>
<Document>
partial class Goo
{
void BlahBlah()
{
}
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyFileRenameAllowedForPartialTypeWithSingleLocationDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
partial class [|$$Test1|]
{
void Blah()
{
}
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyFileRenameAllowedWithMultipleTypesOnMatchingNameDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
class [|$$Test1|]
{
void Blah()
{
}
}
class Test2
{
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyNoFileRenameAllowedWithMultipleTypesDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
class [|$$Goo|]
{
void Blah()
{
}
}
class Test1
{
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyEnumKindSupportsFileRenameDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
enum [|$$Test1|]
{
One,
Two,
Three
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyInterfaceKindSupportsFileRenameDisabledExperiment()
Using workspace = CreateWorkspaceWithWaiter(
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
interface [|$$Test1|]
{
void Blah();
}
</Document>
</Project>
</Workspace>)
Dim session = StartSession(workspace, fileRenameEnabled:=False)
Assert.Equal(InlineRenameFileRenameInfo.NotAllowed, session.FileRenameInfo)
End Using
End Sub
<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyFileRenameNotAllowedForLinkedFiles()
......
......@@ -50,13 +50,8 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Rename
Return Tuple.Create(solution.GetDocument(hostdoc.Id), token.Span)
End Function
Public Function StartSession(workspace As TestWorkspace, Optional fileRenameEnabled As Boolean = True) As InlineRenameSession
Public Function StartSession(workspace As TestWorkspace) As InlineRenameSession
Dim renameService = workspace.GetService(Of IInlineRenameService)()
Dim experiment = workspace.Services.GetRequiredService(Of IExperimentationService)()
Dim fileExperiment = DirectCast(experiment, TestExperimentationService)
fileExperiment.SetExperimentOption(WellKnownExperimentNames.RoslynInlineRenameFile, fileRenameEnabled)
Dim sessionInfo = GetSessionInfo(workspace)
Return DirectCast(renameService.StartInlineSession(sessionInfo.Item1, sessionInfo.Item2).Session, InlineRenameSession)
......
......@@ -31,7 +31,6 @@ internal static class WellKnownExperimentNames
public const string TypeImportCompletion = "Roslyn.TypeImportCompletion";
public const string TargetTypedCompletionFilter = "Roslyn.TargetTypedCompletionFilter";
public const string NativeEditorConfigSupport = "Roslyn.NativeEditorConfigSupport";
public const string RoslynInlineRenameFile = "Roslyn.FileRename";
public const string SortCompletionListByMatch = "Roslyn.SortCompletionListByMatch";
// Syntactic LSP experiment treatments.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册