Skip to content

gogrlx/grlx-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grlx-lsp

Language Server Protocol (LSP) server for grlx recipe files (.grlx).

Features

  • Completion — ingredient.method names, property keys, requisite types, step ID references
  • Diagnostics — unknown ingredients/methods, missing required properties, unknown properties, invalid requisite types
  • Hover — documentation for ingredients, methods, properties, and requisite types

Installation

go install github.com/gogrlx/grlx-lsp/cmd/grlx-lsp@latest

Editor Setup

Neovim (nvim-lspconfig)

vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
  pattern = "*.grlx",
  callback = function()
    vim.bo.filetype = "grlx"
  end,
})

local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

configs.grlx_lsp = {
  default_config = {
    cmd = { "grlx-lsp" },
    filetypes = { "grlx" },
    root_dir = lspconfig.util.find_git_ancestor,
    settings = {},
  },
}

lspconfig.grlx_lsp.setup({})

VS Code

Create .vscode/settings.json:

{
  "files.associations": {
    "*.grlx": "yaml"
  }
}

Then configure a generic LSP client extension to run grlx-lsp for the grlx file type.

Supported Ingredients

Ingredient Methods
cmd run
file absent, append, cached, contains, content, directory, exists, managed, missing, prepend, symlink, touch
group absent, exists, present
pkg cleaned, group_installed, held, installed, key_managed, latest, purged, removed, repo_managed
service disabled, enabled, masked, restarted, running, stopped, unmasked
user absent, exists, present

Recipe Format

grlx recipes are YAML files with Go template support:

include:
  - apache
  - .dev

steps:
  install nginx:
    pkg.installed:
      - name: nginx
  start nginx:
    service.running:
      - name: nginx
      - requisites:
        - require: install nginx

License

0BSD

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors