remove whitespaceBefore/After from InlayHint, https://github.com/microsoft/vscode/issues/16221

上级 2f33470e
...@@ -1762,8 +1762,6 @@ export interface InlayHint { ...@@ -1762,8 +1762,6 @@ export interface InlayHint {
text: string; text: string;
position: IPosition; position: IPosition;
kind: InlayHintKind; kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
......
...@@ -183,8 +183,6 @@ export class InlayHintsController implements IEditorContribution { ...@@ -183,8 +183,6 @@ export class InlayHintsController implements IEditorContribution {
const fontColor = this._themeService.getColorTheme().getColor(editorInlayHintForeground); const fontColor = this._themeService.getColorTheme().getColor(editorInlayHintForeground);
const model = this._editor.getModel()!; const model = this._editor.getModel()!;
const newDecorationsTypeIds: string[] = []; const newDecorationsTypeIds: string[] = [];
const newDecorationsData: IModelDeltaDecoration[] = []; const newDecorationsData: IModelDeltaDecoration[] = [];
...@@ -193,15 +191,12 @@ export class InlayHintsController implements IEditorContribution { ...@@ -193,15 +191,12 @@ export class InlayHintsController implements IEditorContribution {
for (const hint of hints) { for (const hint of hints) {
const { text, position, whitespaceBefore, whitespaceAfter } = hint; const { text, position } = hint;
const marginBefore = whitespaceBefore ? (fontSize / 3) | 0 : 0;
const marginAfter = whitespaceAfter ? (fontSize / 3) | 0 : 0;
const contentOptions: IContentDecorationRenderOptions = { const contentOptions: IContentDecorationRenderOptions = {
contentText: fixSpace(text), contentText: fixSpace(text),
backgroundColor: `${backgroundColor}`, backgroundColor: `${backgroundColor}`,
color: `${fontColor}`, color: `${fontColor}`,
margin: `0px ${marginAfter}px 0px ${marginBefore}px`,
fontSize: `${fontSize}px`, fontSize: `${fontSize}px`,
fontFamily: `var(${fontFamilyVar})`, fontFamily: `var(${fontFamilyVar})`,
padding: `0px ${(fontSize / 4) | 0}px`, padding: `0px ${(fontSize / 4) | 0}px`,
......
...@@ -6665,8 +6665,6 @@ declare namespace monaco.languages { ...@@ -6665,8 +6665,6 @@ declare namespace monaco.languages {
text: string; text: string;
position: IPosition; position: IPosition;
kind: InlayHintKind; kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
......
...@@ -1800,14 +1800,6 @@ declare module 'vscode' { ...@@ -1800,14 +1800,6 @@ declare module 'vscode' {
* The kind of this hint. * The kind of this hint.
*/ */
kind?: InlayHintKind; kind?: InlayHintKind;
/**
* Whitespace before the hint.
*/
whitespaceBefore?: boolean;
/**
* Whitespace after the hint.
*/
whitespaceAfter?: boolean;
// todo@API make range first argument // todo@API make range first argument
constructor(text: string, position: Position, kind?: InlayHintKind); constructor(text: string, position: Position, kind?: InlayHintKind);
......
...@@ -1156,9 +1156,7 @@ export namespace InlayHint { ...@@ -1156,9 +1156,7 @@ export namespace InlayHint {
return { return {
text: hint.text, text: hint.text,
position: Position.from(hint.position), position: Position.from(hint.position),
kind: InlayHintKind.from(hint.kind ?? types.InlayHintKind.Other), kind: InlayHintKind.from(hint.kind ?? types.InlayHintKind.Other)
whitespaceBefore: hint.whitespaceBefore,
whitespaceAfter: hint.whitespaceAfter
}; };
} }
...@@ -1168,8 +1166,6 @@ export namespace InlayHint { ...@@ -1168,8 +1166,6 @@ export namespace InlayHint {
Position.to(hint.position), Position.to(hint.position),
InlayHintKind.to(hint.kind) InlayHintKind.to(hint.kind)
); );
res.whitespaceAfter = hint.whitespaceAfter;
res.whitespaceBefore = hint.whitespaceBefore;
return res; return res;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册