Skip to content

Commit dd71c16

Browse files
committed
Adjust volar AutoInsert protocol changes
1 parent c83c236 commit dd71c16

File tree

3 files changed

+13
-42
lines changed

3 files changed

+13
-42
lines changed

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/AutoInsertOptions.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/AutoInsertParams.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class AutoInsertParams {
2828
/**
2929
* The position inside the text document.
3030
*/
31-
private Position position;
31+
private Position selection;
3232

33-
private AutoInsertOptions options;
33+
private AutoInsertLastChange change;
3434

3535

3636
public TextDocumentIdentifier getTextDocument() {
@@ -41,20 +41,20 @@ public void setTextDocument(TextDocumentIdentifier textDocument) {
4141
this.textDocument = textDocument;
4242
}
4343

44-
public Position getPosition() {
45-
return position;
44+
public Position getSelection() {
45+
return selection;
4646
}
4747

48-
public void setPosition(Position position) {
49-
this.position = position;
48+
public void setSelection(Position selection) {
49+
this.selection = selection;
5050
}
5151

52-
public AutoInsertOptions getOptions() {
53-
return options;
52+
public AutoInsertLastChange getChange() {
53+
return change;
5454
}
5555

56-
public void setOptions(AutoInsertOptions options) {
57-
this.options = options;
56+
public void setChange(AutoInsertLastChange options) {
57+
this.change = options;
5858
}
5959

6060
}

org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/vue/autoinsert/VueAutoInsertReconciler.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,16 @@ private void autoInsert(DocumentEvent event) {
7575

7676
AutoInsertParams params = new AutoInsertParams();
7777
params.setTextDocument(identifier);
78-
params.setPosition(LSPEclipseUtils.toPosition(offset + event.getText().length(), document));
79-
80-
AutoInsertOptions opts = new AutoInsertOptions();
78+
params.setSelection(LSPEclipseUtils.toPosition(offset + event.getText().length(), document));
79+
8180
AutoInsertLastChange changeEvent = new AutoInsertLastChange();
8281
final var range = new Range(LSPEclipseUtils.toPosition(offset, document),
8382
LSPEclipseUtils.toPosition(offset + event.fLength, document));
8483
changeEvent.setRange(range);
8584
changeEvent.setText(event.getText());
8685
changeEvent.setRangeLength(event.fLength);
8786
changeEvent.setRangeOffset(offset);
88-
opts.setLastChange(changeEvent);
89-
params.setOptions(opts);
87+
params.setChange(changeEvent);
9088

9189
// consumes String or AutoInsertResponse from Vue Server
9290
info.autoInsert(params)

0 commit comments

Comments
 (0)