Skip to content

Commit

Permalink
Verify different squiggles on .net framework
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Aug 19, 2021
1 parent 44840d6 commit 17683dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ protected CSharpSquigglesCommon(VisualStudioInstanceFactory instanceFactory, str
{
}

protected abstract bool SupportsGlobalUsings { get; }

protected override string LanguageName => LanguageNames.CSharp;

public virtual void VerifySyntaxErrorSquiggles()
Expand All @@ -40,8 +42,11 @@ private static void Sub()
}
}");

var usingsErrorTags = SupportsGlobalUsings ? "Microsoft.VisualStudio.Text.Tagging.ErrorTag:'using System;\\r\\nusing System.Collections.Generic;\\r\\nusing System.Text;'[0-68]"
: "Microsoft.VisualStudio.Text.Tagging.ErrorTag:'using System.Collections.Generic;\\r\\nusing System.Text;'[15-68]";

VisualStudio.Editor.Verify.ErrorTags(
"Microsoft.VisualStudio.Text.Tagging.ErrorTag:'using System;\\r\\nusing System.Collections.Generic;\\r\\nusing System.Text;'[0-68]",
usingsErrorTags,
"Microsoft.VisualStudio.Text.Tagging.ErrorTag:'\\r'[286-287]",
"Microsoft.VisualStudio.Text.Tagging.ErrorTag:'}'[354-355]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace Roslyn.VisualStudio.IntegrationTests.CSharp
[Collection(nameof(SharedIntegrationHostFixture))]
public class CSharpSquigglesDesktop : CSharpSquigglesCommon
{
protected override bool SupportsGlobalUsings => false;

public CSharpSquigglesDesktop(VisualStudioInstanceFactory instanceFactory)
: base(instanceFactory, WellKnownProjectTemplates.ClassLibrary)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Roslyn.VisualStudio.IntegrationTests.CSharp
[Collection(nameof(SharedIntegrationHostFixture))]
public class CSharpSquigglesNetCore : CSharpSquigglesCommon
{
protected override bool SupportsGlobalUsings => true;

public CSharpSquigglesNetCore(VisualStudioInstanceFactory instanceFactory)
: base(instanceFactory, WellKnownProjectTemplates.CSharpNetCoreClassLibrary)
{
Expand Down

0 comments on commit 17683dc

Please sign in to comment.