Skip to content

Minimap: Render search result decorations #75216

@RMacfarlane

Description

@RMacfarlane

Support rendering text decorations in the minimap, beginning with search results. We can add a new option to decorations, similar to overviewRuler in IModelDecorationOptions:

/**
 * Options for rendering a model decoration in the overview ruler.
 */
export interface IModelDecorationOverviewRulerOptions {
	/**
	 * CSS color to render in the overview ruler.
	 * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
	 */
	color: string | ThemeColor | undefined;
	/**
	 * CSS color to render in the overview ruler.
	 * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
	 */
	darkColor?: string | ThemeColor;
	/**
	 * The position in the overview ruler.
	 */
	position: OverviewRulerLane;
}

The new optional minimap property could look like:

/**
 * Options for rendering a model decoration in the overview ruler.
 */
export interface IModelDecorationMinimapOptions {
	/**
	 * CSS color to render in the minimap.
	 * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
	 */
	color: string | ThemeColor | undefined;
	/**
	 * CSS color to render in the minimap.
	 * e.g.: rgba(100, 100, 100, 0.5) or a color from the color registry
	 */
	darkColor?: string | ThemeColor;
	/**
	 * The position in the minimap.
	 */
	position: MinimapPosition; // 'Gutter' or 'Text', i.e. either drawn on the left side of the minimap or using the decoration position to draw it on a specific text range
}

The find widget can then set this property for its decorations, and the minimap can read the decorations from its text model.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions