@@ -1415,7 +1415,7 @@ fn lsp_import_attributes() {
1415
1415
} ,
1416
1416
} ) ) ;
1417
1417
1418
- client. did_open ( json ! ( {
1418
+ client. did_open_raw ( json ! ( {
1419
1419
"textDocument" : {
1420
1420
"uri" : "file:///a/test.json" ,
1421
1421
"languageId" : "json" ,
@@ -2092,7 +2092,6 @@ fn lsp_suggestion_actions_disabled() {
2092
2092
} ,
2093
2093
} ,
2094
2094
} ) ) ;
2095
- client. read_diagnostics ( ) ;
2096
2095
let diagnostics = client. did_open ( json ! ( {
2097
2096
"textDocument" : {
2098
2097
"uri" : temp_dir. url( ) . join( "file.ts" ) . unwrap( ) ,
@@ -14061,10 +14060,10 @@ fn lsp_node_modules_dir() {
14061
14060
"arguments" : [ [ "npm:chalk" , "npm:@types/node" ] , file_uri] ,
14062
14061
} ) ,
14063
14062
) ;
14063
+ client. read_diagnostics ( )
14064
14064
} ;
14065
14065
14066
14066
cache ( & mut client) ;
14067
- client. read_diagnostics ( ) ;
14068
14067
14069
14068
assert ! ( !temp_dir. path( ) . join( "node_modules" ) . exists( ) ) ;
14070
14069
@@ -14095,15 +14094,12 @@ fn lsp_node_modules_dir() {
14095
14094
"imports" : { } ,
14096
14095
} ,
14097
14096
"unstable" : [ ] ,
14098
- } } ) ) ;
14097
+ } } ) )
14099
14098
} ;
14100
- refresh_config ( & mut client) ;
14101
-
14102
- let diagnostics = client. read_diagnostics ( ) ;
14099
+ let diagnostics = refresh_config ( & mut client) ;
14103
14100
assert_eq ! ( diagnostics. all( ) . len( ) , 2 , "{:#?}" , diagnostics) ; // not cached
14104
14101
14105
14102
cache ( & mut client) ;
14106
- client. read_diagnostics ( ) ;
14107
14103
14108
14104
assert ! ( temp_dir. path( ) . join( "node_modules/chalk" ) . exists( ) ) ;
14109
14105
assert ! ( temp_dir. path( ) . join( "node_modules/@types/node" ) . exists( ) ) ;
@@ -14115,10 +14111,7 @@ fn lsp_node_modules_dir() {
14115
14111
"{ \" nodeModulesDir\" : \" auto\" }\n " ,
14116
14112
) ;
14117
14113
refresh_config ( & mut client) ;
14118
- client. read_diagnostics ( ) ;
14119
- cache ( & mut client) ;
14120
-
14121
- let diagnostics = client. read_diagnostics ( ) ;
14114
+ let diagnostics = cache ( & mut client) ;
14122
14115
assert_eq ! ( diagnostics. all( ) . len( ) , 0 , "{:#?}" , diagnostics) ;
14123
14116
14124
14117
assert ! ( lockfile_path. exists( ) ) ;
@@ -14195,7 +14188,7 @@ fn lsp_vendor_dir() {
14195
14188
temp_dir. path ( ) . join ( "deno.json" ) ,
14196
14189
"{ \" vendor\" : true, \" lock\" : false }\n " ,
14197
14190
) ;
14198
- client. change_configuration ( json ! ( { "deno" : {
14191
+ let diagnostics = client. change_configuration ( json ! ( { "deno" : {
14199
14192
"enable" : true ,
14200
14193
"config" : "./deno.json" ,
14201
14194
"codeLens" : {
@@ -14214,7 +14207,6 @@ fn lsp_vendor_dir() {
14214
14207
"unstable" : [ ] ,
14215
14208
} } ) ) ;
14216
14209
14217
- let diagnostics = client. read_diagnostics ( ) ;
14218
14210
// won't be cached until a manual cache occurs
14219
14211
assert_eq ! (
14220
14212
diagnostics
0 commit comments