Skip to content

Daemon methods

The Biome daemon uses JSON-RPC, a lightweight remote procedure call protocol, to talk to third-party clients such as editor extensions. This page lists the methods those clients can call. To start a daemon, see Use the daemon with the binary.

Clients send requests with the following JSON payload, where method is one of the methods on this page. For example, a biome/open_project request looks like this:

{
"jsonrpc": "2.0",
"id": 1,
"method": "biome/open_project",
"params": {
"path": "/Some/path",
"openUninitialized": false
}
}

Accepts SupportsFeatureParams.

interface SupportsFeatureParams {
features: FeatureName;
/**
* Controls whether the ignore checks also cover the directories that contain the file.
*/
ignoreKind: IgnoreKind;
inlineConfig?: Configuration;
/**
* Features that shouldn't be enabled
*/
notRequestedFeatures?: FeatureName;
path: string;
projectKey: number;
skipIgnoreCheck?: boolean;
}

Returns FileFeaturesResult.

interface FileFeaturesResult {
featuresSupported: FeaturesSupported;
}

Accepts UpdateSettingsParams.

interface UpdateSettingsParams {
configuration: Configuration;
extendedConfigurations?: unknown[][];
moduleGraphResolutionKind?: string;
projectKey: number;
workspaceDirectory?: string;
}

Returns UpdateSettingsResult.

interface UpdateSettingsResult {
diagnostics: Diagnostic[];
}

Accepts OpenProjectParams.

interface OpenProjectParams {
/**
* Whether the folder should be opened as a project, even if no `biome.json` can be found.
*/
openUninitialized: boolean;
/**
* The path to open
*/
path: string;
}

Returns OpenProjectResult.

interface OpenProjectResult {
/**
* A unique identifier for this project
*/
projectKey: number;
}

Accepts ScanProjectParams.

interface ScanProjectParams {
/**
* Forces scanning of the folder, even if it is already being watched.
*/
force: boolean;
projectKey: number;
scanKind: ScanKind;
verbose?: boolean;
/**
* Whether the scan should watch every folder it traverses. Referenced-files scans watch only folders containing indexed dependencies.
*/
watch: boolean;
}

Returns ScanProjectResult.

interface ScanProjectResult {
/**
* A list of child configuration files found inside the project
*/
configurationFiles: string[];
/**
* Diagnostics reported while scanning the project.
*/
diagnostics: Diagnostic[];
/**
* Duration of the scan.
*/
duration: Duration;
}

Accepts OpenFileParams.

interface OpenFileParams {
content: FileContent;
documentFileSource?: DocumentFileSource;
/**
* Used to enable further document services e.g. semantic model
*/
editorFeatures?: EditorFeatures;
inlineConfig?: Configuration;
path: string;
/**
* Set to `true` to persist the node cache used during parsing, in order to speed up subsequent reparsing if the document has been edited. This should only be enabled if reparsing is to be expected, such as when the file is opened through the LSP Proxy.
*/
persistNodeCache?: boolean;
projectKey: number;
}

Returns OpenFileResult.

interface OpenFileResult {
diagnostics: Diagnostic[];
}

Accepts ChangeFileParams.

interface ChangeFileParams {
content: string;
/**
* Used to enable further document services e.g. semantic model
*/
editorFeatures?: EditorFeatures;
inlineConfig?: Configuration;
path: string;
projectKey: number;
version: number;
}

Returns ChangeFileResult.

interface ChangeFileResult {
/**
* Problems found while updating dependency and module data. This does not include lint or parse results for the changed file.
*/
diagnostics: Diagnostic[];
}

Accepts CloseFileParams.

interface CloseFileParams {
path: string;
projectKey: number;
}

Returns void.

Accepts FileExistsParams.

interface FileExistsParams {
filePath: string;
}

Returns boolean.

Accepts PathIsIgnoredParams.

interface PathIsIgnoredParams {
/**
* Whether the path is ignored for specific features e.g. `formatter.includes`. When this field is empty, Biome checks only `files.includes`.
*/
features: FeatureName;
/**
* Controls whether the ignore checks also cover the directories that contain the path.
*/
ignoreKind: IgnoreKind;
/**
* Whether the path is a directory. Used to skip stat calls when the caller already knows the file type from the filesystem traversal.
*/
isDir?: boolean;
/**
* The path to inspect
*/
path: string;
projectKey: number;
}

Returns boolean.

Accepts UpdateModuleGraphParams.

interface UpdateModuleGraphParams {
path: string;
projectKey: number;
/**
* The kind of update to apply to the module graph
*/
updateKind: string;
}

Returns void.

Accepts GetSyntaxTreeParams.

interface GetSyntaxTreeParams {
path: string;
projectKey: number;
}

Returns GetSyntaxTreeResult.

interface GetSyntaxTreeResult {
ast: string;
cst: string;
}

Accepts CheckFileSizeParams.

interface CheckFileSizeParams {
path: string;
projectKey: number;
}

Returns CheckFileSizeResult.

interface CheckFileSizeResult {
fileSize: number;
limit: number;
}

Accepts GetFileContentParams.

interface GetFileContentParams {
path: string;
projectKey: number;
}

Returns string.

Accepts GetControlFlowGraphParams.

interface GetControlFlowGraphParams {
cursor: number;
path: string;
projectKey: number;
}

Returns string.

Accepts GetFormatterIRParams.

interface GetFormatterIRParams {
path: string;
projectKey: number;
}

Returns string.

Accepts GetTypeInfoParams.

interface GetTypeInfoParams {
path: string;
projectKey: number;
}

Returns string.

Accepts GetRegisteredTypesParams.

interface GetRegisteredTypesParams {
path: string;
projectKey: number;
}

Returns string.

Accepts GetSemanticModelParams.

interface GetSemanticModelParams {
path: string;
projectKey: number;
}

Returns string.

Accepts GetModuleGraphParams.

interface GetModuleGraphParams {}

Returns GetModuleGraphResult.

interface GetModuleGraphResult {
data: object;
}

Accepts PullDiagnosticsParams.

interface PullDiagnosticsParams {
categories: RuleCategories;
/**
* Minimum severity for a diagnostic to be included. Diagnostics with a severity below this threshold are ignored entirely (not counted, not serialized). Defaults to [`Severity::Hint`] (include everything).
*/
diagnosticLevel?: Severity;
/**
* Rules to apply on top of the configuration
*/
enabledRules?: string[];
/**
* When true, promote assist diagnostics (`assist/*`) to error severity before applying the diagnostic_level filter.
*/
enforceAssist?: boolean;
/**
* When `true`, diagnostics include code suggestions for rule fixes.
*/
includeCodeFix?: boolean;
inlineConfig?: Configuration;
/**
* Max limit of diagnostics types to pull. This limit is meant to cap the number of [Diagnostic] to pull. However, the workspace still processes ALL diagnostics coming from the analyzer to compute their severity. If no value is provided, the workspace will pull all diagnostics.
*/
maxDiagnostics?: unknown;
only?: string[];
path: string;
projectKey: number;
skip?: string[];
}

Returns PullDiagnosticsResult.

interface PullDiagnosticsResult {
diagnostics: Diagnostic[];
errors: number;
infos: number;
/**
* Number of parse errors (subset of `errors`). Used by `--skip-parse-errors` to distinguish parse errors from analyzer errors.
*/
parseErrors: number;
skippedDiagnostics: number;
warnings: number;
}

Accepts ProcessFileParams.

interface ProcessFileParams {
categories: RuleCategories;
content: FileContent;
diagnosticLevel: Severity;
enabledRules?: string[];
enforceAssist: boolean;
fixFileMode?: FixFileMode;
format: boolean;
includeCodeFix: boolean;
maxDiagnostics?: unknown;
only?: string[];
path: string;
projectKey: number;
skip?: string[];
skipParseErrors: boolean;
suppressionReason?: unknown;
write: boolean;
}

Returns ProcessFileResult.

interface ProcessFileResult {
appliedFixes: number;
diagnostics: Diagnostic[];
errors: number;
formatWithErrorsDisabled: boolean;
infos: number;
output?: unknown;
parseErrors: number;
skippedDiagnostics: number;
skippedSuggestedFixes: number;
warnings: number;
}

Accepts PullActionsParams.

interface PullActionsParams {
categories?: RuleCategories;
/**
* When `false`, returned actions have `suggestion: None` (no `BatchMutation` computed). Used by `codeAction/resolve` to defer edit computation.
*/
computeActions?: boolean;
enabledRules?: string[];
inlineConfig?: Configuration;
only?: string[];
path: string;
projectKey: number;
range?: TextRange;
skip?: string[];
suppressionReason?: unknown;
}

Returns PullActionsResult.

interface PullActionsResult {
actions: CodeAction[];
}

Accepts PullDiagnosticsAndActionsParams.

interface PullDiagnosticsAndActionsParams {
categories?: RuleCategories;
enabledRules?: string[];
inlineConfig?: Configuration;
only?: string[];
path: string;
projectKey: number;
skip?: string[];
}

Returns PullDiagnosticsAndActionsResult.

interface PullDiagnosticsAndActionsResult {
diagnostics: unknown[][];
}

Accepts FormatFileParams.

interface FormatFileParams {
inlineConfig?: Configuration;
path: string;
projectKey: number;
}

Returns Printed.

interface Printed {
code: string;
range?: TextRange;
sourcemap: SourceMarker[];
verbatimRanges: TextRange[];
}

Accepts FormatRangeParams.

interface FormatRangeParams {
inlineConfig?: Configuration;
path: string;
projectKey: number;
range: TextRange;
}

Returns Printed.

interface Printed {
code: string;
range?: TextRange;
sourcemap: SourceMarker[];
verbatimRanges: TextRange[];
}

Accepts FormatOnTypeParams.

interface FormatOnTypeParams {
inlineConfig?: Configuration;
offset: number;
path: string;
projectKey: number;
}

Returns Printed.

interface Printed {
code: string;
range?: TextRange;
sourcemap: SourceMarker[];
verbatimRanges: TextRange[];
}

Accepts FixFileParams.

interface FixFileParams {
/**
* Rules to apply to the file
*/
enabledRules?: string[];
fixFileMode: FixFileMode;
inlineConfig?: Configuration;
only?: string[];
path: string;
projectKey: number;
ruleCategories: RuleCategories;
shouldFormat: boolean;
skip?: string[];
suppressionReason?: unknown;
}

Returns FixFileResult.

interface FixFileResult {
/**
* List of all the code actions applied to the file
*/
actions: FixAction[];
/**
* New source code for the file with all fixes applied
*/
code: string;
/**
* Number of errors
*/
errors: number;
/**
* number of skipped suggested fixes
*/
skippedSuggestedFixes: number;
}

Accepts RenameParams.

interface RenameParams {
newName: string;
path: string;
projectKey: number;
symbolAt: number;
}

Returns RenameResult.

interface RenameResult {
/**
* List of text edit operations to apply on the source code
*/
indels: TextEdit;
/**
* Range of source code modified by this rename operation
*/
range: TextRange;
}

Accepts ParsePatternParams.

interface ParsePatternParams {
defaultLanguage: string;
pattern: string;
}

Returns ParsePatternResult.

interface ParsePatternResult {
patternId: string;
}

Accepts SearchPatternParams.

interface SearchPatternParams {
path: string;
pattern: string;
projectKey: number;
}

Returns SearchResults.

interface SearchResults {
matches: TextRange[];
path: string;
}

Accepts DropPatternParams.

interface DropPatternParams {
pattern: string;
}

Returns void.