From 4934a6f487b9ed6b99b900ae0710c7b452792e20 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 19 Nov 2019 17:18:33 -0800 Subject: [PATCH] Validate code action range before passing it to providers Fixes #80288 --- src/vs/editor/contrib/codeAction/codeActionModel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionModel.ts b/src/vs/editor/contrib/codeAction/codeActionModel.ts index 39faf3722d13c..e574348900514 100644 --- a/src/vs/editor/contrib/codeAction/codeActionModel.ts +++ b/src/vs/editor/contrib/codeAction/codeActionModel.ts @@ -73,8 +73,9 @@ class CodeActionOracle extends Disposable { return undefined; } for (const marker of this._markerService.read({ resource: model.uri })) { - if (Range.intersectRanges(marker, selection)) { - return Range.lift(marker); + const markerRange = model.validateRange(marker); + if (Range.intersectRanges(markerRange, selection)) { + return Range.lift(markerRange); } }