File tree Expand file tree Collapse file tree
src/OmniSharp.Roslyn.CSharp/Services/Intellisense
tests/OmniSharp.Roslyn.CSharp.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616namespace OmniSharp . Roslyn . CSharp . Services . Intellisense
1717{
18+ [ Obsolete ( "Please use CompletionService." ) ]
1819 [ OmniSharpHandler ( OmniSharpEndpoints . AutoComplete , LanguageNames . CSharp ) ]
1920 public class IntellisenseService : IRequestHandler < AutoCompleteRequest , IEnumerable < AutoCompleteResponse > >
2021 {
Original file line number Diff line number Diff line change @@ -475,6 +475,33 @@ void M()
475475 Assert . Contains ( @"The ""G"" standard format specifier" , gStandardCompletion . Description ) ;
476476 }
477477
478+ [ ConditionalTheory ( typeof ( WindowsOnly ) ) ]
479+ [ InlineData ( "dummy.cs" ) ]
480+ [ InlineData ( "dummy.csx" ) ]
481+ public async Task Embedded_language_completion_provider_for_regex ( string filename )
482+ {
483+ const string source = @"
484+ using System;
485+ using System.Text.RegularExpressions;
486+ class C
487+ {
488+ void M()
489+ {
490+ var r = Regex.Match(""foo"", ""$$""
491+ }
492+ }
493+ " ;
494+
495+ var completions = await FindCompletionsAsync ( filename , source ) ;
496+
497+ Assert . NotEmpty ( completions ) ;
498+
499+ var wCompletion = completions . FirstOrDefault ( x => x . CompletionText == @"\w" ) ;
500+ Assert . NotNull ( wCompletion ) ;
501+ Assert . Equal ( "word character" , wCompletion . DisplayText ) ;
502+ Assert . Contains ( @"matches any word character" , wCompletion . Description ) ;
503+ }
504+
478505 [ Fact ]
479506 public async Task Scripting_by_default_returns_completions_for_CSharp7_1 ( )
480507 {
Original file line number Diff line number Diff line change 44 <TargetFramework >net472</TargetFramework >
55 <PlatformTarget >AnyCPU</PlatformTarget >
66 <GenerateRuntimeConfigurationFiles >true</GenerateRuntimeConfigurationFiles >
7+ <WarningsNotAsErrors >CS0618</WarningsNotAsErrors >
78 </PropertyGroup >
89
910 <ItemGroup >
You can’t perform that action at this time.
0 commit comments