Skip to content

A minimal 🀏 language πŸ”Š server πŸ“‘ for HTTP 🐼 syntax 🌈.

License

Notifications You must be signed in to change notification settings

mistweaverco/kulala-ls

Repository files navigation

Kulala Logo

kulala-ls

NPM TypeScript Rollup GitHub release (latest by date) Discord

Install β€’Supports β€’ Usage β€’ HTTP File Spec

A minimal 🀏 language πŸ”Š server πŸ“‘ for HTTP 🐼 syntax 🌈.

Kulala is swahili for "rest" or "relax".

Install

Neovim

Warning

Requires Neovim 0.10.0+.

Install language server:

npm install -g @mistweaverco/kulala-ls

Recommended plugins:

Configuration

Via Lazy:

{
  "neovim/nvim-lspconfig",
  config = function()
    local nvim_lsp = require("lspconfig")
    local capabilities = vim.lsp.protocol.make_client_capabilities()
    local servers = {
      "kulala_ls",
    }
    for _, lsp in ipairs(servers) do
      if nvim_lsp[lsp] ~= nil then
        if nvim_lsp[lsp].setup ~= nil then
          nvim_lsp[lsp].setup({
            capabilities = capabilities,
          })
        else
          vim.notify("LSP server " .. lsp .. " does not have a setup function", vim.log.levels.ERROR)
        end
      end
    end
  end,
},
{
  "saghen/blink.cmp",

  build = "cargo build --release",
  version = "*",

  ---@module 'blink.cmp'
  ---@type blink.cmp.Config
  opts = {
    -- 'default' for mappings similar to built-in completion
    -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
    -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
    -- See the full "keymap" documentation for information on defining your own keymap.
    keymap = {
      preset = "default",
      ["<CR>"] = { "select_and_accept", "fallback" },
      cmdline = {
        preset = "default",
      },
    },
    completion = {
      -- Show documentation when selecting a completion item
      documentation = { auto_show = true, auto_show_delay_ms = 500 },
    },

    appearance = {
      -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
      -- Adjusts spacing to ensure icons are aligned
      nerd_font_variant = "mono",
    },

    -- Default list of enabled providers defined so that you can extend it
    -- elsewhere in your config, without redefining it, due to `opts_extend`
    sources = {
      default = {
        "lsp",
        "path",
        "buffer",
      },
    },
  },
}

Supports

  • Variable completion (with support for multiple sources)
    • OS environment (Kulala)
    • http-client.env.json (Kulala and Intellij)
    • http-client.private.env.json (Kulala and Intellij)
    • .env (Kulala and rest-nvim)
    • .vscode/settings.json rest-client.environmentVariables (Kulala and VSCode rest-client)
    • *.code-workspace rest-client.environmentVariables (Kulala and VSCode rest-client)
  • Header name completion
  • Header value completion
  • Method completion
  • Scheme completion
  • HTTP Version completion
  • GraphQL completion via GraphQL schema introspection

GraphQL

You need to have a GraphQL schema file somewhere in your project.

The language server will look for it in the following order:

  1. [filename].graphql-schema.json
  2. graphql-schema.json (Keeps looking up the directory tree until it finds a schema file)