From 17683dc3b8f4904b06478a1621be1d8ad2c60870 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 18 Aug 2021 21:06:35 -0700 Subject: [PATCH] Verify different squiggles on .net framework --- .../IntegrationTests/CSharp/CSharpSquigglesCommon.cs | 7 ++++++- .../IntegrationTests/CSharp/CSharpSquigglesDesktop.cs | 2 ++ .../IntegrationTests/CSharp/CSharpSquigglesNetCore.cs | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesCommon.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesCommon.cs index 0122b1f723ea7..4568e23b7b98c 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesCommon.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesCommon.cs @@ -16,6 +16,8 @@ protected CSharpSquigglesCommon(VisualStudioInstanceFactory instanceFactory, str { } + protected abstract bool SupportsGlobalUsings { get; } + protected override string LanguageName => LanguageNames.CSharp; public virtual void VerifySyntaxErrorSquiggles() @@ -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]"); } diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesDesktop.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesDesktop.cs index 565f0bb1c690b..ac8185651a2ab 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesDesktop.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesDesktop.cs @@ -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) { diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesNetCore.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesNetCore.cs index 158cdcd76feab..f91770cc74892 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesNetCore.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpSquigglesNetCore.cs @@ -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) {