Skip to main content

fileDecorationsAPI

MS Code Extension API


MS Code Extension API / core/extensionAPI/modules/window/fileDecorationsAPI

core/extensionAPI/modules/window/fileDecorationsAPI

Type Aliases

FileDecorationsAPI

FileDecorationsAPI = typeof fileDecorationsAPI

Defined in: core/extensionAPI/modules/window/fileDecorationsAPI.ts:67

Variables

fileDecorationsAPI

const fileDecorationsAPI: object

Defined in: core/extensionAPI/modules/window/fileDecorationsAPI.ts:13

Type Declaration

clear

clear: (path) => void

Remove the decoration from a single path.

Parameters
path

string

Returns

void

clearAll

clearAll: () => void

Remove all decorations (e.g. when user closes git extension).

Returns

void

get

get: (path) => FileDecoration | null

Read the current decoration for a path (for internal use / testing).

Parameters
path

string

Returns

FileDecoration | null

set

set: (path, decoration) => void

Set a decoration badge on a file or folder path.

Parameters
path

string

decoration

FileDecoration

Returns

void

Example
mscode.window.fileDecorations.set('/src/App.tsx', {
badge: 'M',
color: '#e2c08d', // yellow — modified
tooltip: 'Modified',
propagate: true, // parent folders will show a dot
});
setBulk

setBulk: (entries) => void

Set decorations for many paths at once. Ideal after a full git status scan.

Parameters
entries

Record<string, FileDecoration>

Returns

void

Example
mscode.window.fileDecorations.setBulk({
'/src/App.tsx': { badge: 'M', color: '#e2c08d', tooltip: 'Modified', propagate: true },
'/src/NewFile.ts': { badge: 'U', color: '#73c991', tooltip: 'Untracked', propagate: true },
'/src/Deleted.ts': { badge: 'D', color: '#f44747', tooltip: 'Deleted', propagate: true },
});