-- Manual installation approach for Neovim
-- Using lazy.nvim package manager

-- In your lazy.nvim setup:
{
  "YOUR_USERNAME/liquid_lsp",
  build = "cargo build --release",
  ft = { "liquid" },
  config = function()
    -- Ensure the binary is available
    local liquid_lsp_path = vim.fn.stdpath("data") .. "/lazy/liquid_lsp/target/release/liquid_lsp"
    
    -- File type detection
    vim.filetype.add({
      extension = {
        liquid = 'liquid',
      },
      pattern = {
        ['.*%.liquid'] = 'liquid',
      },
    })

    local lspconfig = require('lspconfig')
    local configs = require('lspconfig.configs')
    
    if not configs.liquid_lsp then
      configs.liquid_lsp = {
        default_config = {
          cmd = { liquid_lsp_path },
          filetypes = { 'liquid' },
          root_dir = lspconfig.util.root_pattern('.git', '.'),
          settings = {}
        }
      }
    end

    lspconfig.liquid_lsp.setup({
      capabilities = require('cmp_nvim_lsp').default_capabilities()
    })
  end
}

-- Alternative: Using packer.nvim
use {
  'YOUR_USERNAME/liquid_lsp',
  run = 'cargo build --release',
  ft = { 'liquid' },
  config = function()
    -- Same config as above
  end
}