File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/vs/workbench/api/browser Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -163,14 +163,16 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
163
163
}
164
164
165
165
private async onDropIntoEditor ( editor : ICodeEditor , position : IPosition , dragEvent : DragEvent ) {
166
- if ( ! dragEvent . dataTransfer ) {
166
+ if ( ! dragEvent . dataTransfer || ! editor . hasModel ( ) ) {
167
167
return ;
168
168
}
169
169
const id = this . _editorLocator . getIdOfCodeEditor ( editor ) ;
170
170
if ( typeof id !== 'string' ) {
171
171
return ;
172
172
}
173
173
174
+ const modelVersionNow = editor . getModel ( ) . getVersionId ( ) ;
175
+
174
176
const textEditorDataTransfer : IDataTransfer = new Map < string , IDataTransferItem > ( ) ;
175
177
for ( const item of dragEvent . dataTransfer . items ) {
176
178
if ( item . kind === 'string' ) {
@@ -207,8 +209,10 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
207
209
return ;
208
210
}
209
211
210
- const [ first ] = edits ; // TODO define how to pick the "one snippet edit";
211
- performSnippetEdit ( editor , first ) ;
212
+ if ( editor . getModel ( ) . getVersionId ( ) === modelVersionNow ) {
213
+ const [ first ] = edits ; // TODO@jrieken define how to pick the "one snippet edit";
214
+ performSnippetEdit ( editor , first ) ;
215
+ }
212
216
}
213
217
214
218
// --- from extension host process
You can’t perform that action at this time.
0 commit comments