File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,11 @@ async function applyAutoInsertEdit(
88
88
89
89
const applied = vscode . workspace . applyEdit ( edit ) ;
90
90
if ( ! applied ) {
91
- throw new Error ( 'Tried to insert a comment but an error occurred.' ) ;
91
+ throw new Error ( 'Tried to apply an edit but an error occurred.' ) ;
92
+ }
93
+
94
+ if ( response . command !== undefined ) {
95
+ vscode . commands . executeCommand ( response . command . command , response . command . arguments ) ;
92
96
}
93
97
}
94
98
}
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ export interface OnAutoInsertParams {
59
59
export interface OnAutoInsertResponseItem {
60
60
_vs_textEditFormat : lsp . InsertTextFormat ;
61
61
_vs_textEdit : lsp . TextEdit ;
62
+
63
+ /**
64
+ * An optional command that is executed *after* inserting.
65
+ */
66
+ command ?: Command ;
62
67
}
63
68
64
69
/**
You can’t perform that action at this time.
0 commit comments