@@ -46,6 +46,65 @@ Expect cs(should add required using):
4646 }
4747
4848
49+ Given cs():
50+ using System;
51+
52+ public class Test
53+ {
54+ public Test()
55+ {
56+ Console.WriteLine(Encoding.UTF8.ToString());
57+ }
58+ }
59+
60+ Execute (run fix usings):
61+ call OmniSharpTestInitializeBuffer('FixUsings3')
62+ call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
63+ call OmniSharpTestAwait('OmniSharp#actions#usings#Fix', [])
64+
65+ Expect cs(should add another required using):
66+ using System;
67+ using System.Text;
68+
69+ public class Test
70+ {
71+ public Test()
72+ {
73+ Console.WriteLine(Encoding.UTF8.ToString());
74+ }
75+ }
76+
77+
78+ Given cs():
79+ using System;
80+
81+ public class Test
82+ {
83+ public Test()
84+ {
85+ Console.WriteLine(Encoding.UTF8.ToString());
86+ }
87+ }
88+
89+ Execute (run fix usings with virtualedit=all):
90+ call OmniSharpTestInitializeBuffer('FixUsings4')
91+ set virtualedit=all
92+ call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
93+ call OmniSharpTestAwait('OmniSharp#actions#usings#Fix', [])
94+
95+ Expect cs(should add another required using):
96+ using System;
97+ using System.Text;
98+
99+ public class Test
100+ {
101+ public Test()
102+ {
103+ Console.WriteLine(Encoding.UTF8.ToString());
104+ }
105+ }
106+
107+
49108Given cs():
50109 public class test {
51110 class1 ns1 = new class1();
@@ -62,7 +121,7 @@ Given cs():
62121 }
63122
64123Execute (run fix usings):
65- call OmniSharpTestInitializeBuffer('FixUsings3 ')
124+ call OmniSharpTestInitializeBuffer('FixUsings5 ')
66125 call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
67126 call OmniSharpTestAwait('OmniSharp#actions#usings#Fix', [])
68127
@@ -82,7 +141,7 @@ Expect cs(should not add ambiguous using):
82141 }
83142
84143Execute (should return ambiguous usings to Callback):
85- call OmniSharpTestInitializeBuffer('FixUsings4 ')
144+ call OmniSharpTestInitializeBuffer('FixUsings6 ')
86145 call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
87146 let g:OmniSharp_test_locations = []
88147 function! s:CallbackFixUsings(locations)
@@ -103,7 +162,7 @@ Execute (should return ambiguous usings to Callback):
103162 AssertEqual g:OmniSharp_test_locations[0].lnum, 2
104163
105164Execute (should add ambiguous usings to quickfix):
106- call OmniSharpTestInitializeBuffer('FixUsings5 ')
165+ call OmniSharpTestInitializeBuffer('FixUsings7 ')
107166 call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
108167 " Cannot use OmniSharpTestAwait, as the callback prevents the default quickfix
109168 " behaviour
0 commit comments