validate preview range using model (#235932)

fixes https://github.com/microsoft/vscode/issues/205611
This commit is contained in:
Johannes Rieken
2024-12-12 12:25:29 +01:00
committed by GitHub
parent d44a823588
commit 8d21c9df9d
@@ -229,7 +229,7 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri
if (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES) {
rangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber);
}
rangeToUse = textEditorModel.validateRange(rangeToUse);
const previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse);
return previewValue;
}