@@ -409,23 +409,26 @@ void LSPClient::make_did_open_request(const std::string &file_path) {
409
409
document_uri_to_version[uri] = 1 ;
410
410
}
411
411
412
- void LSPClient::make_did_change_request (const std::string &file_path, const TextDiff &text_diff) {
412
+ void LSPClient::make_did_change_request (const std::string &file_path, const TextModification &text_diff) {
413
413
std::string full_path = get_full_path (file_path);
414
414
std::string uri = to_file_uri (full_path);
415
415
416
416
int &version = document_uri_to_version[uri];
417
417
version++;
418
418
419
- JSON did_change_request = {
420
- {" jsonrpc" , " 2.0" },
421
- {" method" , " textDocument/didChange" },
422
- {" params" ,
423
- {{" textDocument" , {{" uri" , uri}, {" version" , version}}},
424
- {" contentChanges" ,
425
- {{{" range" ,
426
- {{" start" , {{" line" , text_diff.text_range .start_line }, {" character" , text_diff.text_range .start_col }}},
427
- {" end" , {{" line" , text_diff.text_range .end_line }, {" character" , text_diff.text_range .end_col }}}}},
428
- {" text" , text_diff.new_content }}}}}}};
419
+ JSON did_change_request = {{" jsonrpc" , " 2.0" },
420
+ {" method" , " textDocument/didChange" },
421
+ {" params" ,
422
+ {{" textDocument" , {{" uri" , uri}, {" version" , version}}},
423
+ {" contentChanges" ,
424
+ {{{" range" ,
425
+ {{" start" ,
426
+ {{" line" , text_diff.text_range_to_replace .start_line },
427
+ {" character" , text_diff.text_range_to_replace .start_col }}},
428
+ {" end" ,
429
+ {{" line" , text_diff.text_range_to_replace .end_line },
430
+ {" character" , text_diff.text_range_to_replace .end_col }}}}},
431
+ {" text" , text_diff.new_content }}}}}}};
429
432
430
433
lsp_communication.make_json_lsp_request (did_change_request);
431
434
}
0 commit comments