Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Rename and Formatting tests to the new framework #67020

Merged
merged 11 commits into from
Mar 15, 2023
2 changes: 1 addition & 1 deletion docs/wiki/Manual-Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ When doing a test pass, copy this page and consider using these status indicator
| **Typing** | :fast_forward: **General Typing**<br />- Type and paste new constructs<br />- Nothing interferes with verbatim typing | | | |
| | :mag: :fast_forward: **Completion**<br />- Typing new keyword/construct names<br />- Dotting off of new constructs<br />- Matching part of the identifier is highlighted (including word prefix matches) [Visual Studio 2015 Update 1]<br />- Target type preselection [Visual Studio 2017]<br />IntelliSense filtering [Visual Studio 2017] | | | |
| | :fast_forward: **Formatting** <br />- Spacing in and around new constructs<br />- Spacing options<br />- Format Document command<br /> `Tools > Options` settings should be respected | | | |
| | :fast_forward: **Automatic Brace Completion** (*C# only*) <br />- Auto-insert close brace<br />- Shift+Enter commit of IntelliSense and any pending brace completion sessions (Currently C# only: https://github.com/dotnet/roslyn/issues/18065) | | | N/A |
| | :fast_forward: **Automatic Brace Completion** (*C# only*) <br />- Auto-insert close brace<br />- Shift+Enter commit of IntelliSense and any pending brace completion sessions | | | N/A |
| | :fast_forward: **Indentation** <br />- Typing `Enter` in an unfinished statement indents the next line | | | |
| **Navigating** | :mag: :fast_forward: **Go To Definition** <br />- F12 from callsites to definition<br />- Ctrl+click [Visual Studio 2017 version 15.4] | | | |
| | :fast_forward: **Go To Implementation** <br />- Ctrl+F12 to jump from virtual members to their implementations<br />- Jump from inheritable types to their implementations | | | N/A |
Expand Down
5 changes: 1 addition & 4 deletions src/Features/Core/Portable/Rename/SymbolicRenameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ private bool CanRenameAttributePrefix(string triggerText)
// Ok, the symbol is good. Now, make sure that the trigger text starts with the prefix
// of the attribute. If it does, then we can rename just the attribute prefix (otherwise
// we need to rename the entire attribute).
#pragma warning disable IDE0059 // Unnecessary assignment of a value - https://github.com/dotnet/roslyn/issues/45895
var nameWithoutAttribute = GetWithoutAttributeSuffix(this.Symbol.Name);

return triggerText.StartsWith(triggerText); // TODO: Always true? What was it supposed to do?
#pragma warning restore IDE0059 // Unnecessary assignment of a value
return triggerText.StartsWith(nameWithoutAttribute);

bool IsRenamingAttributeTypeWithAttributeSuffix()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.IntegrationTest.Utilities;
using Microsoft.VisualStudio.IntegrationTest.Utilities.Input;
using Microsoft.VisualStudio.IntegrationTest.Utilities.OutOfProcess;
using Roslyn.Test.Utilities;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -76,7 +77,7 @@ public int Method()

MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
VisualStudio.Editor.Verify.TextContains(expectedText);
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(InlineRenameDialog_OutOfProc.ValidRenameTag));

VisualStudio.Editor.SendKeys("SayHello", VirtualKey.Enter);
VisualStudio.Editor.Verify.TextContains(@"private static void SayHello()
Expand Down Expand Up @@ -116,7 +117,7 @@ public int Method()

MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
Assert.Equal(expectedText, VisualStudio.Editor.GetText());
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(InlineRenameDialog_OutOfProc.ValidRenameTag));

VisualStudio.Editor.SendKeys("SayHello", VirtualKey.Enter);
VisualStudio.Editor.Verify.TextContains(@"private static int SayHello(int a, int b)
Expand Down Expand Up @@ -157,7 +158,7 @@ public int Method()

MarkupTestFile.GetSpans(expectedMarkup, out var expectedText, out ImmutableArray<TextSpan> spans);
Assert.Equal(expectedText, VisualStudio.Editor.GetText());
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(VisualStudio.InlineRenameDialog.ValidRenameTag));
AssertEx.SetEqual(spans, VisualStudio.Editor.GetTagSpans(InlineRenameDialog_OutOfProc.ValidRenameTag));
}
}
}
Loading