@@ -383,6 +383,7 @@ fn lsp_import_map_remote() {
383
383
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
384
384
} ) ,
385
385
) ;
386
+ client. read_diagnostics ( ) ;
386
387
387
388
let diagnostics = client. did_open ( json ! ( {
388
389
"textDocument" : {
@@ -829,6 +830,7 @@ fn lsp_deno_json_imports_comments_cache() {
829
830
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
830
831
} ) ,
831
832
) ;
833
+ client. read_diagnostics ( ) ;
832
834
833
835
let diagnostics = client. did_open ( json ! ( {
834
836
"textDocument" : {
@@ -920,6 +922,7 @@ fn lsp_format_vendor_path() {
920
922
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
921
923
} ) ,
922
924
) ;
925
+ client. read_diagnostics ( ) ;
923
926
assert ! ( temp_dir
924
927
. path( )
925
928
. join( "vendor/http_localhost_4545/run/002_hello.ts" )
@@ -2781,6 +2784,7 @@ fn lsp_hover_dependency() {
2781
2784
"arguments" : [ [ ] , "file:///a/file.ts" ] ,
2782
2785
} ) ,
2783
2786
) ;
2787
+ client. read_diagnostics ( ) ;
2784
2788
let res = client. write_request (
2785
2789
"textDocument/hover" ,
2786
2790
json ! ( {
@@ -3165,6 +3169,7 @@ fn lsp_hover_typescript_types() {
3165
3169
] ,
3166
3170
} ) ,
3167
3171
) ;
3172
+ client. read_diagnostics ( ) ;
3168
3173
let res = client. write_request (
3169
3174
"textDocument/hover" ,
3170
3175
json ! ( {
@@ -3214,6 +3219,7 @@ fn lsp_hover_jsr() {
3214
3219
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
3215
3220
} ) ,
3216
3221
) ;
3222
+ client. read_diagnostics ( ) ;
3217
3223
let res = client. write_request (
3218
3224
"textDocument/hover" ,
3219
3225
json ! ( {
@@ -5736,6 +5742,7 @@ fn lsp_jsr_auto_import_completion() {
5736
5742
] ,
5737
5743
} ) ,
5738
5744
) ;
5745
+ client. read_diagnostics ( ) ;
5739
5746
client. did_open ( json ! ( {
5740
5747
"textDocument" : {
5741
5748
"uri" : temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ,
@@ -5815,6 +5822,7 @@ fn lsp_jsr_auto_import_completion_import_map() {
5815
5822
] ,
5816
5823
} ) ,
5817
5824
) ;
5825
+ client. read_diagnostics ( ) ;
5818
5826
client. did_open ( json ! ( {
5819
5827
"textDocument" : {
5820
5828
"uri" : temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ,
@@ -5954,6 +5962,7 @@ fn lsp_jsr_code_action_missing_declaration() {
5954
5962
"arguments" : [ [ ] , file. url( ) ] ,
5955
5963
} ) ,
5956
5964
) ;
5965
+ client. read_diagnostics ( ) ;
5957
5966
client. did_open_file ( & file) ;
5958
5967
let res = client. write_request (
5959
5968
"textDocument/codeAction" ,
@@ -6074,6 +6083,7 @@ fn lsp_jsr_code_action_move_to_new_file() {
6074
6083
"arguments" : [ [ ] , file. url( ) ] ,
6075
6084
} ) ,
6076
6085
) ;
6086
+ client. read_diagnostics ( ) ;
6077
6087
client. did_open_file ( & file) ;
6078
6088
let list = client
6079
6089
. write_request_with_res_as :: < Option < lsp:: CodeActionResponse > > (
@@ -6493,6 +6503,7 @@ fn lsp_code_actions_deno_types_for_npm() {
6493
6503
] ,
6494
6504
} ) ,
6495
6505
) ;
6506
+ client. read_diagnostics ( ) ;
6496
6507
let res = client. write_request (
6497
6508
"textDocument/codeAction" ,
6498
6509
json ! ( {
@@ -6660,6 +6671,7 @@ fn lsp_cache_then_definition() {
6660
6671
] ,
6661
6672
} ) ,
6662
6673
) ;
6674
+ client. read_diagnostics ( ) ;
6663
6675
let res = client. write_request (
6664
6676
"textDocument/definition" ,
6665
6677
json ! ( {
@@ -8093,6 +8105,7 @@ fn lsp_completions_auto_import_node_builtin() {
8093
8105
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
8094
8106
} ) ,
8095
8107
) ;
8108
+ client. read_diagnostics ( ) ;
8096
8109
let list = client. get_completion_list (
8097
8110
temp_dir. url ( ) . join ( "file.ts" ) . unwrap ( ) ,
8098
8111
( 2 , 21 ) ,
@@ -8887,6 +8900,7 @@ fn lsp_npm_types_nested_js_dts() {
8887
8900
"arguments" : [ [ ] , file. url( ) ] ,
8888
8901
} ) ,
8889
8902
) ;
8903
+ client. read_diagnostics ( ) ;
8890
8904
let diagnostics = client. did_open_file ( & file) ;
8891
8905
assert_eq ! (
8892
8906
json!( diagnostics. all( ) ) ,
@@ -8986,6 +9000,7 @@ fn lsp_npm_always_caches() {
8986
9000
] ,
8987
9001
} ) ,
8988
9002
) ;
9003
+ client. read_diagnostics ( ) ;
8989
9004
8990
9005
// now open a new file and chalk should be working
8991
9006
let new_file_uri = temp_dir_path. join ( "new_file.ts" ) . url_file ( ) ;
@@ -9961,6 +9976,7 @@ fn lsp_auto_imports_remote_dts() {
9961
9976
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
9962
9977
} ) ,
9963
9978
) ;
9979
+ client. read_diagnostics ( ) ;
9964
9980
let list = client. get_completion_list (
9965
9981
temp_dir. url ( ) . join ( "file.ts" ) . unwrap ( ) ,
9966
9982
( 2 , 21 ) ,
@@ -10263,6 +10279,7 @@ fn lsp_completions_node_builtin() {
10263
10279
"arguments" : [ [ "npm:@types/node" ] , "file:///a/file.ts" ] ,
10264
10280
} ) ,
10265
10281
) ;
10282
+ client. read_diagnostics ( ) ;
10266
10283
10267
10284
client. write_notification (
10268
10285
"textDocument/didChange" ,
@@ -10330,6 +10347,7 @@ fn lsp_completions_node_specifier_node_modules_dir() {
10330
10347
"arguments" : [ [ ] , temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ] ,
10331
10348
} ) ,
10332
10349
) ;
10350
+ client. read_diagnostics ( ) ;
10333
10351
client. write_notification (
10334
10352
"textDocument/didChange" ,
10335
10353
json ! ( {
@@ -10565,6 +10583,7 @@ fn lsp_cache_location() {
10565
10583
"arguments" : [ [ ] , "file:///a/file.ts" ] ,
10566
10584
} ) ,
10567
10585
) ;
10586
+ client. read_diagnostics ( ) ;
10568
10587
let res = client. write_request (
10569
10588
"textDocument/hover" ,
10570
10589
json ! ( {
@@ -10659,6 +10678,7 @@ fn lsp_tls_cert() {
10659
10678
"arguments" : [ [ ] , "file:///a/file.ts" ] ,
10660
10679
} ) ,
10661
10680
) ;
10681
+ client. read_diagnostics ( ) ;
10662
10682
let res = client. write_request (
10663
10683
"textDocument/hover" ,
10664
10684
json ! ( {
@@ -10757,6 +10777,7 @@ fn lsp_npmrc() {
10757
10777
"arguments" : [ [ ] , file. url( ) ] ,
10758
10778
} ) ,
10759
10779
) ;
10780
+ client. read_diagnostics ( ) ;
10760
10781
let diagnostics = client. did_open_file ( & file) ;
10761
10782
assert_eq ! (
10762
10783
json!( diagnostics. all( ) ) ,
@@ -11153,6 +11174,7 @@ fn lsp_root_with_global_reference_types() {
11153
11174
"arguments" : [ [ ] , file2. url( ) ] ,
11154
11175
} ) ,
11155
11176
) ;
11177
+ client. read_diagnostics ( ) ;
11156
11178
let diagnostics = client. did_open_file ( & file) ;
11157
11179
assert_eq ! ( json!( diagnostics. all( ) ) , json!( [ ] ) ) ;
11158
11180
}
@@ -13194,6 +13216,7 @@ export function B() {
13194
13216
] ,
13195
13217
} ) ,
13196
13218
) ;
13219
+ client. read_diagnostics ( ) ;
13197
13220
let res = client. write_request (
13198
13221
"textDocument/hover" ,
13199
13222
json ! ( {
@@ -13216,10 +13239,6 @@ export function B() {
13216
13239
}
13217
13240
} )
13218
13241
) ;
13219
-
13220
- let diagnostics = client. read_diagnostics ( ) ;
13221
- println ! ( "{:?}" , diagnostics) ;
13222
-
13223
13242
client. shutdown ( ) ;
13224
13243
}
13225
13244
@@ -14045,6 +14064,7 @@ fn lsp_node_modules_dir() {
14045
14064
} ;
14046
14065
14047
14066
cache ( & mut client) ;
14067
+ client. read_diagnostics ( ) ;
14048
14068
14049
14069
assert ! ( !temp_dir. path( ) . join( "node_modules" ) . exists( ) ) ;
14050
14070
@@ -14083,6 +14103,7 @@ fn lsp_node_modules_dir() {
14083
14103
assert_eq ! ( diagnostics. all( ) . len( ) , 2 , "{:#?}" , diagnostics) ; // not cached
14084
14104
14085
14105
cache ( & mut client) ;
14106
+ client. read_diagnostics ( ) ;
14086
14107
14087
14108
assert ! ( temp_dir. path( ) . join( "node_modules/chalk" ) . exists( ) ) ;
14088
14109
assert ! ( temp_dir. path( ) . join( "node_modules/@types/node" ) . exists( ) ) ;
@@ -14542,6 +14563,7 @@ fn lsp_deno_json_scopes_vendor_dir() {
14542
14563
"arguments" : [ [ ] , temp_dir. url( ) . join( "project1/file.ts" ) . unwrap( ) ] ,
14543
14564
} ) ,
14544
14565
) ;
14566
+ client. read_diagnostics ( ) ;
14545
14567
let res = client. write_request (
14546
14568
"textDocument/definition" ,
14547
14569
json ! ( {
@@ -14592,6 +14614,7 @@ fn lsp_deno_json_scopes_vendor_dir() {
14592
14614
"arguments" : [ [ ] , temp_dir. url( ) . join( "project2/file.ts" ) . unwrap( ) ] ,
14593
14615
} ) ,
14594
14616
) ;
14617
+ client. read_diagnostics ( ) ;
14595
14618
let res = client. write_request (
14596
14619
"textDocument/definition" ,
14597
14620
json ! ( {
@@ -14642,6 +14665,7 @@ fn lsp_deno_json_scopes_vendor_dir() {
14642
14665
"arguments" : [ [ ] , temp_dir. url( ) . join( "project2/project3/file.ts" ) . unwrap( ) ] ,
14643
14666
} ) ,
14644
14667
) ;
14668
+ client. read_diagnostics ( ) ;
14645
14669
let res = client. write_request (
14646
14670
"textDocument/definition" ,
14647
14671
json ! ( {
@@ -14725,6 +14749,7 @@ fn lsp_deno_json_scopes_node_modules_dir() {
14725
14749
"arguments" : [ [ ] , temp_dir. url( ) . join( "project1/file.ts" ) . unwrap( ) ] ,
14726
14750
} ) ,
14727
14751
) ;
14752
+ client. read_diagnostics ( ) ;
14728
14753
let res = client. write_request (
14729
14754
"textDocument/definition" ,
14730
14755
json ! ( {
@@ -14778,6 +14803,7 @@ fn lsp_deno_json_scopes_node_modules_dir() {
14778
14803
"arguments" : [ [ ] , temp_dir. url( ) . join( "project2/file.ts" ) . unwrap( ) ] ,
14779
14804
} ) ,
14780
14805
) ;
14806
+ client. read_diagnostics ( ) ;
14781
14807
let res = client. write_request (
14782
14808
"textDocument/definition" ,
14783
14809
json ! ( {
@@ -14828,6 +14854,7 @@ fn lsp_deno_json_scopes_node_modules_dir() {
14828
14854
"arguments" : [ [ ] , temp_dir. url( ) . join( "project2/project3/file.ts" ) . unwrap( ) ] ,
14829
14855
} ) ,
14830
14856
) ;
14857
+ client. read_diagnostics ( ) ;
14831
14858
let res = client. write_request (
14832
14859
"textDocument/definition" ,
14833
14860
json ! ( {
@@ -15807,6 +15834,7 @@ fn lsp_deno_json_workspace_vendor_dir() {
15807
15834
"arguments" : [ [ ] , temp_dir. url( ) . join( "project1/project2/file.ts" ) . unwrap( ) ] ,
15808
15835
} ) ,
15809
15836
) ;
15837
+ client. read_diagnostics ( ) ;
15810
15838
let res = client. write_request (
15811
15839
"textDocument/definition" ,
15812
15840
json ! ( {
@@ -15878,6 +15906,7 @@ fn lsp_deno_json_workspace_node_modules_dir() {
15878
15906
"arguments" : [ [ ] , temp_dir. url( ) . join( "project1/project2/file.ts" ) . unwrap( ) ] ,
15879
15907
} ) ,
15880
15908
) ;
15909
+ client. read_diagnostics ( ) ;
15881
15910
let res = client. write_request (
15882
15911
"textDocument/definition" ,
15883
15912
json ! ( {
0 commit comments