@@ -168,14 +168,9 @@ def load_addons(include_project_addons: true)
168
168
errored_addons = Addon . addons . select ( &:error? )
169
169
170
170
if errored_addons . any?
171
+ message = "Error loading add-ons:\n \n #{ errored_addons . map ( &:formatted_errors ) . join ( "\n \n " ) } "
171
172
send_message (
172
- Notification . new (
173
- method : "window/showMessage" ,
174
- params : Interface ::ShowMessageParams . new (
175
- type : Constant ::MessageType ::WARNING ,
176
- message : "Error loading add-ons:\n \n #{ errored_addons . map ( &:formatted_errors ) . join ( "\n \n " ) } " ,
177
- ) ,
178
- ) ,
173
+ Notification . window_show_message ( message , type : Constant ::MessageType ::WARNING ) ,
179
174
)
180
175
181
176
unless @test_mode
@@ -380,13 +375,7 @@ def text_document_did_open(message)
380
375
MESSAGE
381
376
382
377
send_message (
383
- Notification . new (
384
- method : "window/logMessage" ,
385
- params : Interface ::LogMessageParams . new (
386
- type : Constant ::MessageType ::WARNING ,
387
- message : log_message ,
388
- ) ,
389
- ) ,
378
+ Notification . window_log_message ( log_message , type : Constant ::MessageType ::WARNING ) ,
390
379
)
391
380
end
392
381
end
@@ -400,10 +389,7 @@ def text_document_did_close(message)
400
389
401
390
# Clear diagnostics for the closed file, so that they no longer appear in the problems tab
402
391
send_message (
403
- Notification . new (
404
- method : "textDocument/publishDiagnostics" ,
405
- params : Interface ::PublishDiagnosticsParams . new ( uri : uri . to_s , diagnostics : [ ] ) ,
406
- ) ,
392
+ Notification . clear_diagnostics ( uri ) ,
407
393
)
408
394
end
409
395
end
@@ -1171,27 +1157,16 @@ def process_indexing_configuration(indexing_options)
1171
1157
1172
1158
if File . exist? ( index_path )
1173
1159
begin
1174
- @global_state . index . configuration . apply_config ( YAML . parse_file ( index_path ) . to_ruby )
1160
+ message = "The .index.yml configuration file is deprecated. " \
1161
+ "Please use editor settings to configure the index"
1175
1162
send_message (
1176
- Notification . new (
1177
- method : "window/showMessage" ,
1178
- params : Interface ::ShowMessageParams . new (
1179
- type : Constant ::MessageType ::WARNING ,
1180
- message : "The .index.yml configuration file is deprecated. " \
1181
- "Please use editor settings to configure the index" ,
1182
- ) ,
1183
- ) ,
1163
+ Notification . window_show_message ( message , type : Constant ::MessageType ::WARNING ) ,
1184
1164
)
1165
+ @global_state . index . configuration . apply_config ( YAML . parse_file ( index_path ) . to_ruby )
1185
1166
rescue Psych ::SyntaxError => e
1186
1167
message = "Syntax error while loading configuration: #{ e . message } "
1187
1168
send_message (
1188
- Notification . new (
1189
- method : "window/showMessage" ,
1190
- params : Interface ::ShowMessageParams . new (
1191
- type : Constant ::MessageType ::WARNING ,
1192
- message : message ,
1193
- ) ,
1194
- ) ,
1169
+ Notification . window_show_message ( message , type : Constant ::MessageType ::WARNING ) ,
1195
1170
)
1196
1171
end
1197
1172
return
0 commit comments