diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs index b042f092d8..82199418bd 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs @@ -15,6 +15,7 @@ namespace OmniSharp.Roslyn.CSharp.Services.Intellisense { + [Obsolete("Please use CompletionService.")] [OmniSharpHandler(OmniSharpEndpoints.AutoComplete, LanguageNames.CSharp)] public class IntellisenseService : IRequestHandler> { diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs index d53baa0c6f..909d7c9895 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs @@ -475,6 +475,33 @@ void M() Assert.Contains(@"The ""G"" standard format specifier", gStandardCompletion.Description); } + [ConditionalTheory(typeof(WindowsOnly))] + [InlineData("dummy.cs")] + [InlineData("dummy.csx")] + public async Task Embedded_language_completion_provider_for_regex(string filename) + { + const string source = @" + using System; + using System.Text.RegularExpressions; + class C + { + void M() + { + var r = Regex.Match(""foo"", ""$$"" + } + } + "; + + var completions = await FindCompletionsAsync(filename, source); + + Assert.NotEmpty(completions); + + var wCompletion = completions.FirstOrDefault(x => x.CompletionText == @"\w"); + Assert.NotNull(wCompletion); + Assert.Equal("word character", wCompletion.DisplayText); + Assert.Contains(@"matches any word character", wCompletion.Description); + } + [Fact] public async Task Scripting_by_default_returns_completions_for_CSharp7_1() { diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj index b62c699c6e..fbddead4eb 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj @@ -4,6 +4,7 @@ net472 AnyCPU true + CS0618