@@ -156,10 +156,10 @@ public async Task SpecialArgTypes() {
156156 [ TestMethod , Priority ( 0 ) ]
157157 public async Task TestPackageImportStar ( ) {
158158 using ( var server = await CreateServerAsync ( PythonVersions . LatestAvailable3X ) ) {
159- var fob = server . AddModuleWithContent ( "fob" , "fob\\ __init__.py" , "from oar import *" ) ;
160- var oar = server . AddModuleWithContent ( "fob.oar" , "fob\\ oar\\ __init__.py" , "from .baz import *" ) ;
161- var baz = server . AddModuleWithContent ( "fob.oar.baz" , "fob\\ oar\\ baz.py" , "import fob.oar.quox as quox\r \n func = quox.func" ) ;
162- var quox = server . AddModuleWithContent ( "fob.oar.quox" , "fob\\ oar\\ quox.py" , "def func(): return 42" ) ;
159+ var fob = await server . AddModuleWithContentAsync ( "fob" , "fob\\ __init__.py" , "from oar import *" ) ;
160+ var oar = await server . AddModuleWithContentAsync ( "fob.oar" , "fob\\ oar\\ __init__.py" , "from .baz import *" ) ;
161+ var baz = await server . AddModuleWithContentAsync ( "fob.oar.baz" , "fob\\ oar\\ baz.py" , "import fob.oar.quox as quox\r \n func = quox.func" ) ;
162+ var quox = await server . AddModuleWithContentAsync ( "fob.oar.quox" , "fob\\ oar\\ quox.py" , "def func(): return 42" ) ;
163163
164164 var fobAnalysis = await fob . GetAnalysisAsync ( ) ;
165165 var oarAnalysis = await oar . GetAnalysisAsync ( ) ;
@@ -559,7 +559,7 @@ public async Task RecursiveDictionaryKeyValues() {
559559i = x['y']['x']['value']
560560s = y['x']['y']['value']
561561" ;
562- server . SendDidChangeTextDocument ( uri , code ) ;
562+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
563563 analysis = await server . GetAnalysisAsync ( uri ) ;
564564
565565 analysis . Should ( ) . HaveVariable ( "i" ) . OfTypes ( BuiltinTypeId . Int )
@@ -745,7 +745,7 @@ def __init__(self, value):
745745 ) ;
746746
747747 text1 = text1 . Substring ( 0 , text1 . IndexOf ( " def" ) ) + Environment . NewLine + text1 . Substring ( text1 . IndexOf ( " def" ) ) ;
748- server . SendDidChangeTextDocument ( uri1 , text1 ) ;
748+ await server . SendDidChangeTextDocumentAsync ( uri1 , text1 ) ;
749749
750750 references = await server . SendFindReferences ( uri1 , 5 , 9 ) ;
751751 references . Should ( ) . OnlyHaveReferences (
@@ -755,7 +755,7 @@ def __init__(self, value):
755755 ) ;
756756
757757 text2 = Environment . NewLine + text2 ;
758- server . SendDidChangeTextDocument ( uri2 , text2 ) ;
758+ await server . SendDidChangeTextDocumentAsync ( uri2 , text2 ) ;
759759
760760 references = await server . SendFindReferences ( uri1 , 5 , 9 ) ;
761761 references . Should ( ) . OnlyHaveReferences (
@@ -799,7 +799,7 @@ import mod1
799799z = mod1.f('abc')
800800" ;
801801
802- server . SendDidChangeTextDocument ( uri2 , text2 ) ;
802+ await server . SendDidChangeTextDocumentAsync ( uri2 , text2 ) ;
803803 analysis2 = await server . GetAnalysisAsync ( uri2 ) ;
804804
805805 analysis1 . Should ( ) . HaveFunction ( "f" )
@@ -902,7 +902,7 @@ def __init__(self):
902902 self.f(_C__A=42) # sig help should be _C__A
903903" ;
904904
905- server . SendDidChangeTextDocument ( uri , code ) ;
905+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
906906 await server . GetAnalysisAsync ( uri ) ;
907907
908908 var signatures = await server . SendSignatureHelp ( uri , 3 , 15 ) ;
@@ -928,7 +928,7 @@ def __init__(self):
928928
929929" ;
930930
931- server . SendDidChangeTextDocument ( uri , code ) ;
931+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
932932 await server . GetAnalysisAsync ( uri ) ;
933933
934934 completions = await server . SendCompletion ( uri , 3 , 13 ) ;
@@ -948,7 +948,7 @@ def f(self):
948948xyz = C._C__FOB # Advanced members completion should work here
949949" ;
950950
951- server . SendDidChangeTextDocument ( uri , code ) ;
951+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
952952 await server . GetAnalysisAsync ( uri ) ;
953953
954954 completions = await server . SendCompletion ( uri , 5 , 16 ) ;
@@ -1018,7 +1018,7 @@ class C(A, B): pass
10181018c = C()
10191019" ;
10201020
1021- server . SendDidChangeTextDocument ( uri , code ) ;
1021+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
10221022 analysis = await server . GetAnalysisAsync ( uri ) ;
10231023
10241024 analysis . Should ( ) . HaveClassInfo ( "C" )
@@ -1032,7 +1032,7 @@ class G(F,E): pass
10321032G.remember2buy
10331033" ;
10341034
1035- server . SendDidChangeTextDocument ( uri , code ) ;
1035+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
10361036 analysis = await server . GetAnalysisAsync ( uri ) ;
10371037
10381038 analysis . Should ( ) . HaveClassInfo ( "G" )
@@ -1047,7 +1047,7 @@ class G(E,F): pass
10471047G.remember2buy
10481048" ;
10491049
1050- server . SendDidChangeTextDocument ( uri , code ) ;
1050+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
10511051 analysis = await server . GetAnalysisAsync ( uri ) ;
10521052
10531053 analysis . Should ( ) . HaveClassInfo ( "G" )
@@ -1067,7 +1067,7 @@ class Z(K1,K2,K3): pass
10671067z = Z()
10681068" ;
10691069
1070- server . SendDidChangeTextDocument ( uri , code ) ;
1070+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
10711071 analysis = await server . GetAnalysisAsync ( uri ) ;
10721072
10731073 analysis . Should ( ) . HaveClassInfo ( "Z" )
@@ -1081,7 +1081,7 @@ class C(str): pass
10811081z = None
10821082" ;
10831083
1084- server . SendDidChangeTextDocument ( uri , code ) ;
1084+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
10851085 analysis = await server . GetAnalysisAsync ( uri ) ;
10861086
10871087 analysis . Should ( ) . HaveClassInfo ( "A" ) . WithMethodResolutionOrder ( "A" , "type int" , "type object" )
@@ -1141,7 +1141,7 @@ await server.SendDidOpenTextDocument(uri, @"
11411141 . And . HaveVariable ( "iB" ) . OfType ( BuiltinTypeId . StrIterator )
11421142 . And . HaveVariable ( "iC" ) . OfType ( BuiltinTypeId . ListIterator ) ;
11431143
1144- server . SendDidChangeTextDocument ( uri , @"
1144+ await server . SendDidChangeTextDocumentAsync ( uri , @"
11451145A = [1, 2, 3]
11461146B = 'abc'
11471147C = [1.0, 'a', 3]
@@ -1157,7 +1157,7 @@ await server.SendDidOpenTextDocument(uri, @"
11571157 . And . HaveVariable ( "iB" ) . OfType ( BuiltinTypeId . StrIterator )
11581158 . And . HaveVariable ( "iC" ) . OfType ( BuiltinTypeId . ListIterator ) ;
11591159
1160- server . SendDidChangeTextDocument ( uri , @"
1160+ await server . SendDidChangeTextDocumentAsync ( uri , @"
11611161A = [1, 2, 3]
11621162B = 'abc'
11631163C = [1.0, 'a', 3]
@@ -1174,7 +1174,7 @@ await server.SendDidOpenTextDocument(uri, @"
11741174 . And . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Str )
11751175 . And . HaveVariable ( "c" ) . OfTypes ( BuiltinTypeId . Int , BuiltinTypeId . Str , BuiltinTypeId . Float ) ;
11761176
1177- server . SendDidChangeTextDocument ( uri , @"
1177+ await server . SendDidChangeTextDocumentAsync ( uri , @"
11781178iA = iter(lambda: 1, 2)
11791179iB = iter(lambda: 'abc', None)
11801180iC = iter(lambda: 1, 'abc')
@@ -1213,7 +1213,7 @@ await server.SendDidOpenTextDocument(uri, @"
12131213 . And . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Unicode )
12141214 . And . HaveVariable ( "c" ) . OfTypes ( BuiltinTypeId . Int , BuiltinTypeId . Unicode , BuiltinTypeId . Float ) ;
12151215
1216- server . SendDidChangeTextDocument ( uri , @"
1216+ await server . SendDidChangeTextDocumentAsync ( uri , @"
12171217iA = iter(lambda: 1, 2)
12181218iB = iter(lambda: 'abc', None)
12191219iC = iter(lambda: 1, 'abc')
@@ -2751,7 +2751,7 @@ del self.abc
27512751 print self.abc
27522752
27532753D(42)" ;
2754- server . SendDidChangeTextDocument ( uri , text ) ;
2754+ await server . SendDidChangeTextDocumentAsync ( uri , text ) ;
27552755
27562756 referencesAbc = await server . SendFindReferences ( uri , 4 , 15 ) ;
27572757 referencesFob = await server . SendFindReferences ( uri , 4 , 21 ) ;
@@ -2795,7 +2795,7 @@ def f(): pass
27952795def f(): pass
27962796
27972797x = f" ;
2798- server . SendDidChangeTextDocument ( uri , text ) ;
2798+ await server . SendDidChangeTextDocumentAsync ( uri , text ) ;
27992799 referencesF = await server . SendFindReferences ( uri , 3 , 5 ) ;
28002800
28012801 referencesF . Should ( ) . OnlyHaveReferences (
@@ -3695,7 +3695,8 @@ public async Task SetLiteral() {
36953695 using ( var server = await CreateServerAsync ( ) ) {
36963696 var analysis = await server . OpenDefaultDocumentAndGetAnalysisAsync ( code ) ;
36973697
3698- analysis . Should ( ) . HaveVariable ( "x" ) . WithDescription ( "set[int]" )
3698+ analysis . Should ( )
3699+ . HaveVariable ( "x" ) . WithDescription ( "set[int]" )
36993700 . And . HaveVariable ( "abc" ) . OfType ( BuiltinTypeId . Int ) ;
37003701 }
37013702 }
@@ -5347,26 +5348,29 @@ class C(object):
53475348 var uriFob = await server . OpenDocumentAndGetUriAsync ( "fob.py" , fobSrc ) ;
53485349 var uriOar = await server . OpenDocumentAndGetUriAsync ( "oar.py" , oarSrc ) ;
53495350 var uriBaz = await server . OpenDocumentAndGetUriAsync ( "baz.py" , bazSrc ) ;
5350- server . SendDidChangeTextDocument ( uriFob , "from oar import C" ) ;
5351+ await server . SendDidChangeTextDocumentAsync ( uriFob , "from oar import C" ) ;
53515352
53525353 var references = await server . SendFindReferences ( uriFob , 0 , 17 ) ;
53535354 references . Should ( ) . OnlyHaveReferences (
53545355 ( uriFob , ( 0 , 16 , 0 , 17 ) , ReferenceKind . Reference ) ,
53555356 ( uriOar , ( 1 , 0 , 2 , 8 ) , ReferenceKind . Value ) ,
5356- ( uriOar , ( 1 , 6 , 1 , 7 ) , ReferenceKind . Definition )
5357+ ( uriOar , ( 1 , 6 , 1 , 7 ) , ReferenceKind . Definition ) ,
5358+ ( uriOar , ( 0 , 0 , 0 , 0 ) , ReferenceKind . Definition )
53575359 ) ;
53585360
5361+ await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
53595362 var analysis = await server . GetAnalysisAsync ( uriFob ) ;
53605363 analysis . Should ( ) . HaveVariable ( "C" ) . WithDescription ( "C" ) ;
53615364
53625365 // delete the class..
5363- server . SendDidChangeTextDocument ( uriOar , "" ) ;
5366+ await server . SendDidChangeTextDocumentAsync ( uriOar , "" ) ;
53645367
5368+ await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
53655369 analysis = await server . GetAnalysisAsync ( uriFob ) ;
5366- analysis . Should ( ) . NotHaveVariable ( "C" ) ;
5370+ analysis . Should ( ) . HaveVariable ( "C" ) . WithNoTypes ( ) ;
53675371
53685372 // Change location of the class
5369- server . SendDidChangeTextDocument ( uriFob , "from baz import C" ) ;
5373+ await server . SendDidChangeTextDocumentAsync ( uriFob , "from baz import C" ) ;
53705374
53715375 references = await server . SendFindReferences ( uriFob , 0 , 17 ) ;
53725376 references . Should ( ) . OnlyHaveReferences (
@@ -5409,7 +5413,8 @@ import fob.y as y
54095413 await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
54105414 var analysis = await server . GetAnalysisAsync ( uriSrc2 ) ;
54115415
5412- analysis . Should ( ) . HaveVariable ( "y" ) . WithDescription ( "Python module fob.y" )
5416+ analysis . Should ( )
5417+ . HaveVariable ( "y" ) . WithDescription ( "Python module fob.y" )
54135418 . And . HaveVariable ( "abc" ) . OfType ( BuiltinTypeId . Int ) ;
54145419 }
54155420 }
@@ -7662,7 +7667,7 @@ private async Task PermutedTestAsync(string prefix, string[] code, Action<IReadO
76627667 var content = code [ p [ i ] ] ;
76637668 var filename = name . Replace ( '.' , '\\ ' ) + ".py" ;
76647669
7665- entries [ p [ i ] ] = server . AddModuleWithContent ( name , filename , content ) ;
7670+ entries [ p [ i ] ] = await server . AddModuleWithContentAsync ( name , filename , content ) ;
76667671 }
76677672
76687673 var analysis = entries
0 commit comments