Daemon methods
The Biome daemon uses JSON-RPC, a lightweight RPC (remote procedure call) protocol that can be leveraged by third-party clients, such as editor extensions.
Clients send requests with the following JSON payload, where method is one of the methods listed on this page. Below is an example of a biome/open_project request:
{ "jsonrpc": "2.0", "id": 1, "method": "biome/open_project", "params": { "path": "/Some/path", "openUninitialized": false }}Custom methods
Section titled “Custom methods”biome/file_features
Section titled “biome/file_features”Accepts SupportsFeatureParams.
interface SupportsFeatureParams { features: FeatureName; inlineConfig?: Configuration; /** * Features that shouldn't be enabled */ notRequestedFeatures?: FeatureName; path: string; projectKey: number; skipIgnoreCheck?: boolean;}Returns FileFeaturesResult.
interface FileFeaturesResult { featuresSupported: FeaturesSupported;}biome/update_settings
Section titled “biome/update_settings”Accepts UpdateSettingsParams.
interface UpdateSettingsParams { configuration: Configuration; extendedConfigurations?: unknown[][]; moduleGraphResolutionKind?: string; projectKey: number; workspaceDirectory?: string;}Returns UpdateSettingsResult.
interface UpdateSettingsResult { diagnostics: Diagnostic[];}biome/open_project
Section titled “biome/open_project”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;}biome/scan_project
Section titled “biome/scan_project”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 watcher should watch this path. Does nothing if the watcher is already watching this path. */ 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;}biome/open_file
Section titled “biome/open_file”Accepts OpenFileParams.
interface OpenFileParams { content: FileContent; documentFileSource?: DocumentFileSource; 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[];}biome/change_file
Section titled “biome/change_file”Accepts ChangeFileParams.
interface ChangeFileParams { content: string; inlineConfig?: Configuration; path: string; projectKey: number; version: number;}Returns ChangeFileResult.
interface ChangeFileResult { diagnostics: Diagnostic[];}biome/close_file
Section titled “biome/close_file”Accepts CloseFileParams.
interface CloseFileParams { path: string; projectKey: number;}Returns void.
biome/file_exists
Section titled “biome/file_exists”Accepts FileExitsParams.
interface FileExitsParams { filePath: string;}Returns boolean.
biome/is_path_ignored
Section titled “biome/is_path_ignored”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 how to ignore check should be done */ 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.
biome/update_module_graph
Section titled “biome/update_module_graph”Accepts UpdateModuleGraphParams.
interface UpdateModuleGraphParams { path: string; projectKey: number; /** * The kind of update to apply to the module graph */ updateKind: string;}Returns void.
biome/get_syntax_tree
Section titled “biome/get_syntax_tree”Accepts GetSyntaxTreeParams.
interface GetSyntaxTreeParams { path: string; projectKey: number;}Returns GetSyntaxTreeResult.
interface GetSyntaxTreeResult { ast: string; cst: string;}biome/check_file_size
Section titled “biome/check_file_size”Accepts CheckFileSizeParams.
interface CheckFileSizeParams { path: string; projectKey: number;}Returns CheckFileSizeResult.
interface CheckFileSizeResult { fileSize: number; limit: number;}biome/get_file_content
Section titled “biome/get_file_content”Accepts GetFileContentParams.
interface GetFileContentParams { path: string; projectKey: number;}Returns string.
biome/get_control_flow_graph
Section titled “biome/get_control_flow_graph”Accepts GetControlFlowGraphParams.
interface GetControlFlowGraphParams { cursor: number; path: string; projectKey: number;}Returns string.
biome/get_formatter_ir
Section titled “biome/get_formatter_ir”Accepts GetFormatterIRParams.
interface GetFormatterIRParams { path: string; projectKey: number;}Returns string.
biome/get_type_info
Section titled “biome/get_type_info”Accepts GetTypeInfoParams.
interface GetTypeInfoParams { path: string; projectKey: number;}Returns string.
biome/get_registered_types
Section titled “biome/get_registered_types”Accepts GetRegisteredTypesParams.
interface GetRegisteredTypesParams { path: string; projectKey: number;}Returns string.
biome/get_semantic_model
Section titled “biome/get_semantic_model”Accepts GetSemanticModelParams.
interface GetSemanticModelParams { path: string; projectKey: number;}Returns string.
biome/get_module_graph
Section titled “biome/get_module_graph”Accepts GetModuleGraphParams.
interface GetModuleGraphParams {}Returns GetModuleGraphResult.
interface GetModuleGraphResult { data: object;}biome/pull_diagnostics
Section titled “biome/pull_diagnostics”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;}biome/pull_actions
Section titled “biome/pull_actions”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[];}biome/pull_diagnostics_and_actions
Section titled “biome/pull_diagnostics_and_actions”Accepts PullDiagnosticsAndActionsParams.
interface PullDiagnosticsAndActionsParams { categories?: RuleCategories; enabledRules?: string[]; inlineConfig?: Configuration; only?: string[]; path: string; projectKey: number; skip?: string[];}Returns PullDiagnosticsAndActionsResult.
interface PullDiagnosticsAndActionsResult { diagnostics: unknown[][];}biome/format_file
Section titled “biome/format_file”Accepts FormatFileParams.
interface FormatFileParams { inlineConfig?: Configuration; path: string; projectKey: number;}Returns Printed.
interface Printed { code: string; range?: TextRange; sourcemap: SourceMarker[]; verbatimRanges: TextRange[];}biome/format_range
Section titled “biome/format_range”Accepts FormatRangeParams.
interface FormatRangeParams { inlineConfig?: Configuration; path: string; projectKey: number; range: TextRange;}Returns Printed.
interface Printed { code: string; range?: TextRange; sourcemap: SourceMarker[]; verbatimRanges: TextRange[];}biome/format_on_type
Section titled “biome/format_on_type”Accepts FormatOnTypeParams.
interface FormatOnTypeParams { inlineConfig?: Configuration; offset: number; path: string; projectKey: number;}Returns Printed.
interface Printed { code: string; range?: TextRange; sourcemap: SourceMarker[]; verbatimRanges: TextRange[];}biome/fix_file
Section titled “biome/fix_file”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;}biome/rename
Section titled “biome/rename”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;}biome/parse_pattern
Section titled “biome/parse_pattern”Accepts ParsePatternParams.
interface ParsePatternParams { defaultLanguage: GritTargetLanguage; pattern: string;}Returns ParsePatternResult.
interface ParsePatternResult { patternId: string;}biome/search_pattern
Section titled “biome/search_pattern”Accepts SearchPatternParams.
interface SearchPatternParams { path: string; pattern: string; projectKey: number;}Returns SearchResults.
interface SearchResults { matches: TextRange[]; path: string;}biome/drop_pattern
Section titled “biome/drop_pattern”Accepts DropPatternParams.
interface DropPatternParams { pattern: string;}Returns void.
Copyright (c) 2023-present Biome Developers and Contributors.