diff --git a/src/vs/editor/contrib/snippet/snippetSession.ts b/src/vs/editor/contrib/snippet/snippetSession.ts index 1c183f104c5ef9776d5d04680331ab048edbd260..7d5e74e4ad2cb5b74849f1ddbded7f6edb059772 100644 --- a/src/vs/editor/contrib/snippet/snippetSession.ts +++ b/src/vs/editor/contrib/snippet/snippetSession.ts @@ -182,6 +182,14 @@ export class OneSnippet { const id = this._placeholderDecorations.get(placeholder); const range = this._editor.getModel().getDecorationRange(id); + if (!range) { + // one of the placeholder lost its decoration and + // therefore we bail out and pretend the placeholder + // (with its mirrors) doesn't exist anymore. + result.delete(placeholder.index); + break; + } + ranges.push(range); } }