Skip to content

Commit

Permalink
Merge pull request #1951 from OmniSharp/feature/obsolete-autocomplete
Browse files Browse the repository at this point in the history
Marked /autocomplete as obsolete
  • Loading branch information
filipw authored Sep 21, 2020
2 parents 4346937 + f4a318a commit fd2c430
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace OmniSharp.Roslyn.CSharp.Services.Intellisense
{
[Obsolete("Please use CompletionService.")]
[OmniSharpHandler(OmniSharpEndpoints.AutoComplete, LanguageNames.CSharp)]
public class IntellisenseService : IRequestHandler<AutoCompleteRequest, IEnumerable<AutoCompleteResponse>>
{
Expand Down
27 changes: 27 additions & 0 deletions tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net472</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit fd2c430

Please sign in to comment.