Skip to content

detecting and using biome present in system path #76

@adrtivv

Description

@adrtivv

This extension should only download the biome binary when it cannot detect it in the system path. This is required for the extension to work on nixos because nixos is not FHS compliant and it doesn't allow running the biome binary present at $XDG_DATA_HOME/zed/extensions/work/biome/node_modules/@biomejs/cli-linux-x64/biome where this extension installs it to by default.

An approach similar to how markdown-oxide extension for zed-editor does it would get the job done as shown here.

For the time being I'm having to provide a custom path to the biome binary in the nix store:

{
  lib,
  pkgs,
  ...
}: {
  programs.zed-editor = {
    extensions = [
      "biome"
    ];
    enable = true;
    userSettings = {
      lsp = {
        biome = {
          # https://github.com/biomejs/biome-zed/blob/main/CONTRIBUTING.md#custom-biome-binary
          binary = {
            arguments = ["lsp-proxy"];
            path = lib.getExe pkgs.biome;
          };
        };
      };
    };
  };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions