From 690db82ef2cd3468c68c0f2abddd2e1e11e772b3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 12 Nov 2020 12:54:56 +0100 Subject: [PATCH] tweak fix for #29210 and thereby fix https://github.com/microsoft/vscode/issues/106090 --- src/vs/editor/contrib/suggest/suggestModel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/suggest/suggestModel.ts b/src/vs/editor/contrib/suggest/suggestModel.ts index a2eeafb5b87..9a88e1ccc1d 100644 --- a/src/vs/editor/contrib/suggest/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/suggestModel.ts @@ -20,7 +20,7 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { WordDistance } from 'vs/editor/contrib/suggest/wordDistance'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { isLowSurrogate, isHighSurrogate } from 'vs/base/common/strings'; +import { isLowSurrogate, isHighSurrogate, getLeadingWhitespace } from 'vs/base/common/strings'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ILogService } from 'vs/platform/log/common/log'; @@ -559,7 +559,8 @@ export class SuggestModel implements IDisposable { return; } - if (ctx.leadingWord.startColumn < this._context.leadingWord.startColumn) { + if (getLeadingWhitespace(ctx.leadingLineContent) !== getLeadingWhitespace(this._context.leadingLineContent)) { + // cancel IntelliSense when line start changes // happens when the current word gets outdented this.cancel(); return; -- GitLab