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(
8888
8989 const applied = vscode . workspace . applyEdit ( edit ) ;
9090 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 ) ;
9296 }
9397 }
9498}
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ export interface OnAutoInsertParams {
5959export interface OnAutoInsertResponseItem {
6060 _vs_textEditFormat : lsp . InsertTextFormat ;
6161 _vs_textEdit : lsp . TextEdit ;
62+
63+ /**
64+ * An optional command that is executed *after* inserting.
65+ */
66+ command ?: Command ;
6267}
6368
6469/**
You can’t perform that action at this time.
0 commit comments