issue template
This commit is contained in:
parent
894692f380
commit
46df6ae7e6
2 changed files with 60 additions and 18 deletions
46
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: File a bug with live-server.nvim
|
||||||
|
title: "Bug Report"
|
||||||
|
labels: ""
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- Be sure you can affirm the following: -->
|
||||||
|
<!-- 1. live-server is up to date and functioning correctly (run `live-server` in the terminal) -->
|
||||||
|
<!-- 2. I have searched the issue tracker and not found a similar issue -->
|
||||||
|
|
||||||
|
### Info
|
||||||
|
|
||||||
|
- Operating System:
|
||||||
|
- `nvim --version`:
|
||||||
|
- Node package manager:
|
||||||
|
- `<node-package-manager> --version`:
|
||||||
|
- `live-server --version`:
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
<!-- Replace the below with your live-server.nvim setup -->
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require('live-server').setup {
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- Replace the below with your *neovim* package manager setup -->
|
||||||
|
|
||||||
|
```lua
|
||||||
|
require('nvim-package-manager').setup {
|
||||||
|
-- Any special plugin config
|
||||||
|
{
|
||||||
|
'barrett-ruth/live-server.nvim',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- A clear and concise description of the bug -->
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local function log(message, level)
|
local function log(message, level)
|
||||||
vim.notify_once(
|
vim.notify(
|
||||||
string.format('import-cost.nvim: %s', message),
|
string.format('live-server.nvim: %s', message),
|
||||||
vim.log.levels[level]
|
vim.log.levels[level]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
@ -30,50 +30,46 @@ end
|
||||||
local job_cache = {}
|
local job_cache = {}
|
||||||
|
|
||||||
M.start = function()
|
M.start = function()
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local dir = vim.fn.expand '%:p:h'
|
||||||
|
|
||||||
local cmd = { 'live-server' }
|
local cmd = { 'live-server' }
|
||||||
vim.list_extend(cmd, M.config.args)
|
vim.list_extend(cmd, M.config.args)
|
||||||
|
|
||||||
if job_cache[bufnr] then
|
if job_cache[dir] then
|
||||||
log('live-server instance already running', 'INFO')
|
log('live-server instance already running', 'INFO')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local job_id = vim.fn.jobstart(cmd, {
|
local job_id = vim.fn.jobstart(cmd, {
|
||||||
on_stderr = function(_, data)
|
on_stderr = function(_, data)
|
||||||
if data[1] == '' then
|
if not data or data[1] == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Remove color from error
|
||||||
log(data[1]:match '.-m(.-)\27', 'ERROR')
|
log(data[1]:match '.-m(.-)\27', 'ERROR')
|
||||||
end,
|
end,
|
||||||
on_exit = function(_, exit_code)
|
on_exit = function(_, exit_code)
|
||||||
job_cache[bufnr] = nil
|
job_cache[dir] = nil
|
||||||
|
|
||||||
if exit_code == 0 then
|
if exit_code == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
log(
|
log(string.format('stopped with code %s', exit_code), 'INFO')
|
||||||
string.format(
|
|
||||||
'live-server stopped unexpectedly with exit code %s',
|
|
||||||
exit_code
|
|
||||||
),
|
|
||||||
'ERROR'
|
|
||||||
)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
job_cache[bufnr] = job_id
|
log('live-server running', 'INFO')
|
||||||
|
job_cache[dir] = job_id
|
||||||
end
|
end
|
||||||
|
|
||||||
M.stop = function()
|
M.stop = function()
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local dir = vim.fn.expand '%:p:h'
|
||||||
|
|
||||||
if job_cache[bufnr] then
|
if job_cache[dir] then
|
||||||
vim.fn.jobstop(job_cache[bufnr])
|
vim.fn.jobstop(job_cache[dir])
|
||||||
job_cache[bufnr] = nil
|
job_cache[dir] = nil
|
||||||
else
|
else
|
||||||
log('no live-server instance running', 'INFO')
|
log('no live-server instance running', 'INFO')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue