Skip to content

Commit

Permalink
chore(troubleshooting/minimal.lua): use lazy.minit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jun 29, 2024
1 parent 5490838 commit af4de6a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 55 deletions.
21 changes: 18 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,25 @@ body:
attributes:
label: "The minimal config used to reproduce this issue."
description: |
See [this example](https://github.com/mrcjkb/rustaceanvim/blob/master/troubleshooting/minimal.lua).
Run with `nvim -u minimal.lua`
placeholder: |
-- Paste your minimal config here. Please base it on the example provided by this plugin,
-- including any additional plugins that must be installed for the issue to be reproducible.
vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
require('lazy.minit').repro {
spec = {
{
'mrcjkb/rustaceanvim',
version = '^4',
init = function()
-- Configure rustaceanvim here
vim.g.rustaceanvim = {}
end,
lazy = false,
},
},
}
-- do anything else you need to do to reproduce the issue
render: "Lua"
validations:
required: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ doc/tags
result/
.direnv
.luarc.json
.repro
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,7 @@ To troubleshoot this plugin with a minimal config in a temporary directory,
you can try [minimal.lua](./troubleshooting/minimal.lua).

```console
mkdir -p /tmp/minimal/
NVIM_DATA_MINIMAL="/tmp/minimal" NVIM_APP_NAME="nvim-minimal" nvim -u NORC -u minimal.lua
nvim -u minimal.lua
```

> [!NOTE]
Expand Down
64 changes: 14 additions & 50 deletions troubleshooting/minimal.lua
Original file line number Diff line number Diff line change
@@ -1,52 +1,16 @@
-- Minimal nvim config with lazy
-- Assumes a directory in $NVIM_DATA_MINIMAL
-- Start with
--
-- export NVIM_DATA_MINIMAL=$(mktemp -d)
-- export NVIM_APP_NAME="nvim-ht-minimal"
-- nvim -u NORC -u minimal.lua
--
-- Then exit out of neovim and start again.
vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()

-- Ignore default config
local config_path = vim.fn.stdpath('config')
vim.opt.rtp:remove(config_path)

-- Ignore default plugins
local data_path = vim.fn.stdpath('data')
local pack_path = data_path .. '/site'
vim.opt.packpath:remove(pack_path)

-- bootstrap lazy.nvim
data_path = assert(os.getenv('NVIM_DATA_MINIMAL'), '$NVIM_DATA_MINIMAL environment variable not set!')
local lazypath = data_path .. '/lazy/lazy.nvim'
local uv = vim.uv
---@diagnostic disable-next-line: deprecated
or vim.loop
if not uv.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)

local lazy = require('lazy')

lazy.setup({
{
'mrcjkb/rustaceanvim',
version = '^4',
init = function()
-- Configure rustaceanvim here
vim.g.rustaceanvim = {}
end,
lazy = false,
require('lazy.minit').repro {
spec = {
{
'mrcjkb/rustaceanvim',
version = '^4',
init = function()
-- Configure rustaceanvim here
vim.g.rustaceanvim = {}
end,
lazy = false,
},
},
-- Add any other plugins needed to reproduce the issue.
-- see https://github.com/folke/lazy.nvim#-lazynvim for details.
}, { root = data_path, state = data_path .. '/lazy-state.json', lockfile = data_path .. '/lazy-lock.json' })
}

0 comments on commit af4de6a

Please sign in to comment.