Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class AutoInsertParams {
/**
* The position inside the text document.
*/
private Position position;
private Position selection;

private AutoInsertOptions options;
private AutoInsertLastChange change;


public TextDocumentIdentifier getTextDocument() {
Expand All @@ -41,20 +41,20 @@ public void setTextDocument(TextDocumentIdentifier textDocument) {
this.textDocument = textDocument;
}

public Position getPosition() {
return position;
public Position getSelection() {
return selection;
}

public void setPosition(Position position) {
this.position = position;
public void setSelection(Position selection) {
this.selection = selection;
}

public AutoInsertOptions getOptions() {
return options;
public AutoInsertLastChange getChange() {
return change;
}

public void setOptions(AutoInsertOptions options) {
this.options = options;
public void setChange(AutoInsertLastChange options) {
this.change = options;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,16 @@ private void autoInsert(DocumentEvent event) {

AutoInsertParams params = new AutoInsertParams();
params.setTextDocument(identifier);
params.setPosition(LSPEclipseUtils.toPosition(offset + event.getText().length(), document));

AutoInsertOptions opts = new AutoInsertOptions();
params.setSelection(LSPEclipseUtils.toPosition(offset + event.getText().length(), document));

AutoInsertLastChange changeEvent = new AutoInsertLastChange();
final var range = new Range(LSPEclipseUtils.toPosition(offset, document),
LSPEclipseUtils.toPosition(offset + event.fLength, document));
changeEvent.setRange(range);
changeEvent.setText(event.getText());
changeEvent.setRangeLength(event.fLength);
changeEvent.setRangeOffset(offset);
opts.setLastChange(changeEvent);
params.setOptions(opts);
params.setChange(changeEvent);

// consumes String or AutoInsertResponse from Vue Server
info.autoInsert(params)
Expand Down
Loading