@@ -156,10 +156,10 @@ public async Task SpecialArgTypes() {
156
156
[ TestMethod , Priority ( 0 ) ]
157
157
public async Task TestPackageImportStar ( ) {
158
158
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" ) ;
163
163
164
164
var fobAnalysis = await fob . GetAnalysisAsync ( ) ;
165
165
var oarAnalysis = await oar . GetAnalysisAsync ( ) ;
@@ -559,7 +559,7 @@ public async Task RecursiveDictionaryKeyValues() {
559
559
i = x['y']['x']['value']
560
560
s = y['x']['y']['value']
561
561
" ;
562
- server . SendDidChangeTextDocument ( uri , code ) ;
562
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
563
563
analysis = await server . GetAnalysisAsync ( uri ) ;
564
564
565
565
analysis . Should ( ) . HaveVariable ( "i" ) . OfTypes ( BuiltinTypeId . Int )
@@ -745,7 +745,7 @@ def __init__(self, value):
745
745
) ;
746
746
747
747
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 ) ;
749
749
750
750
references = await server . SendFindReferences ( uri1 , 5 , 9 ) ;
751
751
references . Should ( ) . OnlyHaveReferences (
@@ -755,7 +755,7 @@ def __init__(self, value):
755
755
) ;
756
756
757
757
text2 = Environment . NewLine + text2 ;
758
- server . SendDidChangeTextDocument ( uri2 , text2 ) ;
758
+ await server . SendDidChangeTextDocumentAsync ( uri2 , text2 ) ;
759
759
760
760
references = await server . SendFindReferences ( uri1 , 5 , 9 ) ;
761
761
references . Should ( ) . OnlyHaveReferences (
@@ -799,7 +799,7 @@ import mod1
799
799
z = mod1.f('abc')
800
800
" ;
801
801
802
- server . SendDidChangeTextDocument ( uri2 , text2 ) ;
802
+ await server . SendDidChangeTextDocumentAsync ( uri2 , text2 ) ;
803
803
analysis2 = await server . GetAnalysisAsync ( uri2 ) ;
804
804
805
805
analysis1 . Should ( ) . HaveFunction ( "f" )
@@ -902,7 +902,7 @@ def __init__(self):
902
902
self.f(_C__A=42) # sig help should be _C__A
903
903
" ;
904
904
905
- server . SendDidChangeTextDocument ( uri , code ) ;
905
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
906
906
await server . GetAnalysisAsync ( uri ) ;
907
907
908
908
var signatures = await server . SendSignatureHelp ( uri , 3 , 15 ) ;
@@ -928,7 +928,7 @@ def __init__(self):
928
928
929
929
" ;
930
930
931
- server . SendDidChangeTextDocument ( uri , code ) ;
931
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
932
932
await server . GetAnalysisAsync ( uri ) ;
933
933
934
934
completions = await server . SendCompletion ( uri , 3 , 13 ) ;
@@ -948,7 +948,7 @@ def f(self):
948
948
xyz = C._C__FOB # Advanced members completion should work here
949
949
" ;
950
950
951
- server . SendDidChangeTextDocument ( uri , code ) ;
951
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
952
952
await server . GetAnalysisAsync ( uri ) ;
953
953
954
954
completions = await server . SendCompletion ( uri , 5 , 16 ) ;
@@ -1018,7 +1018,7 @@ class C(A, B): pass
1018
1018
c = C()
1019
1019
" ;
1020
1020
1021
- server . SendDidChangeTextDocument ( uri , code ) ;
1021
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
1022
1022
analysis = await server . GetAnalysisAsync ( uri ) ;
1023
1023
1024
1024
analysis . Should ( ) . HaveClassInfo ( "C" )
@@ -1032,7 +1032,7 @@ class G(F,E): pass
1032
1032
G.remember2buy
1033
1033
" ;
1034
1034
1035
- server . SendDidChangeTextDocument ( uri , code ) ;
1035
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
1036
1036
analysis = await server . GetAnalysisAsync ( uri ) ;
1037
1037
1038
1038
analysis . Should ( ) . HaveClassInfo ( "G" )
@@ -1047,7 +1047,7 @@ class G(E,F): pass
1047
1047
G.remember2buy
1048
1048
" ;
1049
1049
1050
- server . SendDidChangeTextDocument ( uri , code ) ;
1050
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
1051
1051
analysis = await server . GetAnalysisAsync ( uri ) ;
1052
1052
1053
1053
analysis . Should ( ) . HaveClassInfo ( "G" )
@@ -1067,7 +1067,7 @@ class Z(K1,K2,K3): pass
1067
1067
z = Z()
1068
1068
" ;
1069
1069
1070
- server . SendDidChangeTextDocument ( uri , code ) ;
1070
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
1071
1071
analysis = await server . GetAnalysisAsync ( uri ) ;
1072
1072
1073
1073
analysis . Should ( ) . HaveClassInfo ( "Z" )
@@ -1081,7 +1081,7 @@ class C(str): pass
1081
1081
z = None
1082
1082
" ;
1083
1083
1084
- server . SendDidChangeTextDocument ( uri , code ) ;
1084
+ await server . SendDidChangeTextDocumentAsync ( uri , code ) ;
1085
1085
analysis = await server . GetAnalysisAsync ( uri ) ;
1086
1086
1087
1087
analysis . Should ( ) . HaveClassInfo ( "A" ) . WithMethodResolutionOrder ( "A" , "type int" , "type object" )
@@ -1141,7 +1141,7 @@ await server.SendDidOpenTextDocument(uri, @"
1141
1141
. And . HaveVariable ( "iB" ) . OfType ( BuiltinTypeId . StrIterator )
1142
1142
. And . HaveVariable ( "iC" ) . OfType ( BuiltinTypeId . ListIterator ) ;
1143
1143
1144
- server . SendDidChangeTextDocument ( uri , @"
1144
+ await server . SendDidChangeTextDocumentAsync ( uri , @"
1145
1145
A = [1, 2, 3]
1146
1146
B = 'abc'
1147
1147
C = [1.0, 'a', 3]
@@ -1157,7 +1157,7 @@ await server.SendDidOpenTextDocument(uri, @"
1157
1157
. And . HaveVariable ( "iB" ) . OfType ( BuiltinTypeId . StrIterator )
1158
1158
. And . HaveVariable ( "iC" ) . OfType ( BuiltinTypeId . ListIterator ) ;
1159
1159
1160
- server . SendDidChangeTextDocument ( uri , @"
1160
+ await server . SendDidChangeTextDocumentAsync ( uri , @"
1161
1161
A = [1, 2, 3]
1162
1162
B = 'abc'
1163
1163
C = [1.0, 'a', 3]
@@ -1174,7 +1174,7 @@ await server.SendDidOpenTextDocument(uri, @"
1174
1174
. And . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Str )
1175
1175
. And . HaveVariable ( "c" ) . OfTypes ( BuiltinTypeId . Int , BuiltinTypeId . Str , BuiltinTypeId . Float ) ;
1176
1176
1177
- server . SendDidChangeTextDocument ( uri , @"
1177
+ await server . SendDidChangeTextDocumentAsync ( uri , @"
1178
1178
iA = iter(lambda: 1, 2)
1179
1179
iB = iter(lambda: 'abc', None)
1180
1180
iC = iter(lambda: 1, 'abc')
@@ -1213,7 +1213,7 @@ await server.SendDidOpenTextDocument(uri, @"
1213
1213
. And . HaveVariable ( "b" ) . OfType ( BuiltinTypeId . Unicode )
1214
1214
. And . HaveVariable ( "c" ) . OfTypes ( BuiltinTypeId . Int , BuiltinTypeId . Unicode , BuiltinTypeId . Float ) ;
1215
1215
1216
- server . SendDidChangeTextDocument ( uri , @"
1216
+ await server . SendDidChangeTextDocumentAsync ( uri , @"
1217
1217
iA = iter(lambda: 1, 2)
1218
1218
iB = iter(lambda: 'abc', None)
1219
1219
iC = iter(lambda: 1, 'abc')
@@ -2751,7 +2751,7 @@ del self.abc
2751
2751
print self.abc
2752
2752
2753
2753
D(42)" ;
2754
- server . SendDidChangeTextDocument ( uri , text ) ;
2754
+ await server . SendDidChangeTextDocumentAsync ( uri , text ) ;
2755
2755
2756
2756
referencesAbc = await server . SendFindReferences ( uri , 4 , 15 ) ;
2757
2757
referencesFob = await server . SendFindReferences ( uri , 4 , 21 ) ;
@@ -2795,7 +2795,7 @@ def f(): pass
2795
2795
def f(): pass
2796
2796
2797
2797
x = f" ;
2798
- server . SendDidChangeTextDocument ( uri , text ) ;
2798
+ await server . SendDidChangeTextDocumentAsync ( uri , text ) ;
2799
2799
referencesF = await server . SendFindReferences ( uri , 3 , 5 ) ;
2800
2800
2801
2801
referencesF . Should ( ) . OnlyHaveReferences (
@@ -3695,7 +3695,8 @@ public async Task SetLiteral() {
3695
3695
using ( var server = await CreateServerAsync ( ) ) {
3696
3696
var analysis = await server . OpenDefaultDocumentAndGetAnalysisAsync ( code ) ;
3697
3697
3698
- analysis . Should ( ) . HaveVariable ( "x" ) . WithDescription ( "set[int]" )
3698
+ analysis . Should ( )
3699
+ . HaveVariable ( "x" ) . WithDescription ( "set[int]" )
3699
3700
. And . HaveVariable ( "abc" ) . OfType ( BuiltinTypeId . Int ) ;
3700
3701
}
3701
3702
}
@@ -5347,26 +5348,29 @@ class C(object):
5347
5348
var uriFob = await server . OpenDocumentAndGetUriAsync ( "fob.py" , fobSrc ) ;
5348
5349
var uriOar = await server . OpenDocumentAndGetUriAsync ( "oar.py" , oarSrc ) ;
5349
5350
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" ) ;
5351
5352
5352
5353
var references = await server . SendFindReferences ( uriFob , 0 , 17 ) ;
5353
5354
references . Should ( ) . OnlyHaveReferences (
5354
5355
( uriFob , ( 0 , 16 , 0 , 17 ) , ReferenceKind . Reference ) ,
5355
5356
( 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 )
5357
5359
) ;
5358
5360
5361
+ await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
5359
5362
var analysis = await server . GetAnalysisAsync ( uriFob ) ;
5360
5363
analysis . Should ( ) . HaveVariable ( "C" ) . WithDescription ( "C" ) ;
5361
5364
5362
5365
// delete the class..
5363
- server . SendDidChangeTextDocument ( uriOar , "" ) ;
5366
+ await server . SendDidChangeTextDocumentAsync ( uriOar , "" ) ;
5364
5367
5368
+ await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
5365
5369
analysis = await server . GetAnalysisAsync ( uriFob ) ;
5366
- analysis . Should ( ) . NotHaveVariable ( "C" ) ;
5370
+ analysis . Should ( ) . HaveVariable ( "C" ) . WithNoTypes ( ) ;
5367
5371
5368
5372
// Change location of the class
5369
- server . SendDidChangeTextDocument ( uriFob , "from baz import C" ) ;
5373
+ await server . SendDidChangeTextDocumentAsync ( uriFob , "from baz import C" ) ;
5370
5374
5371
5375
references = await server . SendFindReferences ( uriFob , 0 , 17 ) ;
5372
5376
references . Should ( ) . OnlyHaveReferences (
@@ -5409,7 +5413,8 @@ import fob.y as y
5409
5413
await server . WaitForCompleteAnalysisAsync ( CancellationToken . None ) ;
5410
5414
var analysis = await server . GetAnalysisAsync ( uriSrc2 ) ;
5411
5415
5412
- analysis . Should ( ) . HaveVariable ( "y" ) . WithDescription ( "Python module fob.y" )
5416
+ analysis . Should ( )
5417
+ . HaveVariable ( "y" ) . WithDescription ( "Python module fob.y" )
5413
5418
. And . HaveVariable ( "abc" ) . OfType ( BuiltinTypeId . Int ) ;
5414
5419
}
5415
5420
}
@@ -7662,7 +7667,7 @@ private async Task PermutedTestAsync(string prefix, string[] code, Action<IReadO
7662
7667
var content = code [ p [ i ] ] ;
7663
7668
var filename = name . Replace ( '.' , '\\ ' ) + ".py" ;
7664
7669
7665
- entries [ p [ i ] ] = server . AddModuleWithContent ( name , filename , content ) ;
7670
+ entries [ p [ i ] ] = await server . AddModuleWithContentAsync ( name , filename , content ) ;
7666
7671
}
7667
7672
7668
7673
var analysis = entries
0 commit comments