From ee56349b8b315de51f74dd38eed3f614c3a7e1a3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 21 Sep 2021 14:23:00 +0200 Subject: [PATCH] remove whitespaceBefore/After from InlayHint, https://github.com/microsoft/vscode/issues/16221 --- src/vs/editor/common/modes.ts | 2 -- src/vs/editor/contrib/inlayHints/inlayHintsController.ts | 7 +------ src/vs/monaco.d.ts | 2 -- src/vs/vscode.proposed.d.ts | 8 -------- src/vs/workbench/api/common/extHostTypeConverters.ts | 6 +----- 5 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index e2abc3de9bc..91a757c7f42 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1762,8 +1762,6 @@ export interface InlayHint { text: string; position: IPosition; kind: InlayHintKind; - whitespaceBefore?: boolean; - whitespaceAfter?: boolean; } export interface InlayHintsProvider { diff --git a/src/vs/editor/contrib/inlayHints/inlayHintsController.ts b/src/vs/editor/contrib/inlayHints/inlayHintsController.ts index 2d44064ad87..8943fdd6cd2 100644 --- a/src/vs/editor/contrib/inlayHints/inlayHintsController.ts +++ b/src/vs/editor/contrib/inlayHints/inlayHintsController.ts @@ -183,8 +183,6 @@ export class InlayHintsController implements IEditorContribution { const fontColor = this._themeService.getColorTheme().getColor(editorInlayHintForeground); const model = this._editor.getModel()!; - - const newDecorationsTypeIds: string[] = []; const newDecorationsData: IModelDeltaDecoration[] = []; @@ -193,15 +191,12 @@ export class InlayHintsController implements IEditorContribution { for (const hint of hints) { - const { text, position, whitespaceBefore, whitespaceAfter } = hint; - const marginBefore = whitespaceBefore ? (fontSize / 3) | 0 : 0; - const marginAfter = whitespaceAfter ? (fontSize / 3) | 0 : 0; + const { text, position } = hint; const contentOptions: IContentDecorationRenderOptions = { contentText: fixSpace(text), backgroundColor: `${backgroundColor}`, color: `${fontColor}`, - margin: `0px ${marginAfter}px 0px ${marginBefore}px`, fontSize: `${fontSize}px`, fontFamily: `var(${fontFamilyVar})`, padding: `0px ${(fontSize / 4) | 0}px`, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index b58924637d5..11f7ea1b39b 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -6665,8 +6665,6 @@ declare namespace monaco.languages { text: string; position: IPosition; kind: InlayHintKind; - whitespaceBefore?: boolean; - whitespaceAfter?: boolean; } export interface InlayHintsProvider { diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 5837d44b84a..3c902c1a4e0 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1800,14 +1800,6 @@ declare module 'vscode' { * The kind of this hint. */ kind?: InlayHintKind; - /** - * Whitespace before the hint. - */ - whitespaceBefore?: boolean; - /** - * Whitespace after the hint. - */ - whitespaceAfter?: boolean; // todo@API make range first argument constructor(text: string, position: Position, kind?: InlayHintKind); diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index 1b32b078f32..5cb84cd2581 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -1156,9 +1156,7 @@ export namespace InlayHint { return { text: hint.text, position: Position.from(hint.position), - kind: InlayHintKind.from(hint.kind ?? types.InlayHintKind.Other), - whitespaceBefore: hint.whitespaceBefore, - whitespaceAfter: hint.whitespaceAfter + kind: InlayHintKind.from(hint.kind ?? types.InlayHintKind.Other) }; } @@ -1168,8 +1166,6 @@ export namespace InlayHint { Position.to(hint.position), InlayHintKind.to(hint.kind) ); - res.whitespaceAfter = hint.whitespaceAfter; - res.whitespaceBefore = hint.whitespaceBefore; return res; } } -- GitLab