error notifications
This commit is contained in:
parent
cccd7110f4
commit
6bdbcbcbd3
@ -8,6 +8,7 @@ local global_state = require("telescope.state")
|
||||
local utils = require("nvim-flutter-companion.utils")
|
||||
|
||||
local M = {}
|
||||
local companion_title = "Flutter Companion"
|
||||
local config = {
|
||||
use_coc = true
|
||||
}
|
||||
@ -34,7 +35,19 @@ local flutter_run_device = function(id)
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command("FlutterRun -d " .. id)
|
||||
if vim.fn.exists(":FlutterRun") ~= 0 then
|
||||
vim.api.nvim_command("FlutterRun -d " .. id)
|
||||
return
|
||||
end
|
||||
vim.notify(
|
||||
{
|
||||
"Run device requires 'coc-flutter/coc-flutter-tools' if using CoC or 'flutter-tools.nvim' if using native LSP."
|
||||
},
|
||||
"error",
|
||||
{
|
||||
title = companion_title
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
local load_table = function(path)
|
||||
@ -142,11 +155,11 @@ local start_spinner = function(name, get_active)
|
||||
local function update_spinner()
|
||||
if get_active() then
|
||||
local next_record =
|
||||
require("notify").notify(
|
||||
vim.notify(
|
||||
"Detecting " .. name .. "...",
|
||||
"info",
|
||||
{
|
||||
title = "Flutter Action",
|
||||
title = companion_title,
|
||||
hide_from_history = true,
|
||||
icon = spinner_frames[(spinner % #spinner_frames) + 1],
|
||||
replace = record
|
||||
@ -201,7 +214,7 @@ function M.flutter_list(is_emulators)
|
||||
)
|
||||
|
||||
if #items == 0 then
|
||||
vim.notify("No " .. name .. " were found", "error", {title = "Flutter Action"})
|
||||
vim.notify("No " .. name .. " were found", "error", {title = companion_title})
|
||||
else
|
||||
global_state.set_global_key("selected_entry", nil)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user