わりとflutter

This commit is contained in:
Rikuoh Tsujitani 2024-07-14 18:02:35 +09:00
parent a2ef05296b
commit 1f9ee460ef
Signed by: riq0h
GPG key ID: 010F09DEA298C717

View file

@ -158,7 +158,7 @@ require("lazy").setup({
{ "leoluz/nvim-dap-go", ft = "go" }, { "leoluz/nvim-dap-go", ft = "go" },
{ "mxsdev/nvim-dap-vscode-js", ft = "javascript" }, { "mxsdev/nvim-dap-vscode-js", ft = "javascript" },
{ "mfussenegger/nvim-dap-python", ft = "python" }, { "mfussenegger/nvim-dap-python", ft = "python" },
{ "akinsho/flutter-tools.nvim", ft = "dart", event = "LspAttach" }, { "akinsho/flutter-tools.nvim", ft = "dart" },
{ "nvimdev/lspsaga.nvim", event = "LspAttach" }, { "nvimdev/lspsaga.nvim", event = "LspAttach" },
{ "is0n/jaq-nvim", event = "LspAttach" }, { "is0n/jaq-nvim", event = "LspAttach" },
{ "j-hui/fidget.nvim", config = true, event = "LspAttach" }, { "j-hui/fidget.nvim", config = true, event = "LspAttach" },
@ -327,7 +327,6 @@ vim.keymap.set("n", "<leader>n", "<cmd>Telescope lsp_references<CR>")
vim.keymap.set("n", "<leader>m", "<cmd>Telescope diagnostics<CR>") vim.keymap.set("n", "<leader>m", "<cmd>Telescope diagnostics<CR>")
vim.keymap.set("n", "<leader>x", "<cmd>Telescope lsp_document_symbols<CR>") vim.keymap.set("n", "<leader>x", "<cmd>Telescope lsp_document_symbols<CR>")
vim.keymap.set("n", "<leader>f", "<cmd>Telescope file_browser<CR>") vim.keymap.set("n", "<leader>f", "<cmd>Telescope file_browser<CR>")
vim.keymap.set("n", "<leader>0", require("telescope").extensions.flutter.commands, { desc = "Open command Flutter" })
local fb_actions = require("telescope").extensions.file_browser.actions local fb_actions = require("telescope").extensions.file_browser.actions
local previewers = require("telescope.previewers") local previewers = require("telescope.previewers")
@ -391,10 +390,6 @@ require("mason-nvim-dap").setup({
ensure_installed = {}, ensure_installed = {},
handlers = {}, handlers = {},
}) })
require("lspconfig").sourcekit.setup({
cmd = { "/usr/bin/sourcekit-lsp" },
filetypes = { "swift" },
})
require("mason-lspconfig").setup() require("mason-lspconfig").setup()
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
function(server_name) function(server_name)
@ -512,6 +507,25 @@ require("dapui").setup({
}, },
}) })
--dap-flutter(debugger is included flutter-tools)
local dap = require("dap")
dap.adapters.flutter = {
type = "executable",
command = "flutter",
args = { "debug_adapter" },
}
dap.configurations.dart = {
{
type = "flutter",
request = "launch",
name = "Launch Flutter Program",
program = "${workspaceFolder}/lib/main.dart",
cwd = "${workspaceFolder}",
},
}
--nvim-dap-vscode-js --nvim-dap-vscode-js
local dap = require("dap") local dap = require("dap")
@ -581,18 +595,15 @@ require("flutter-tools").setup({
enabled = false, enabled = false,
}, },
debugger = { debugger = {
enabled = false, enabled = true,
run_via_dap = false, run_via_dap = true,
register_configurations = function(_)
require("dap").adapters.dart = {
type = "executable",
command = vim.fn.stdpath("data") .. "/mason/bin/dart-debug-adapter",
args = { "flutter" },
}
end,
}, },
}) })
vim.keymap.set("n", "<leader>0", require("telescope").extensions.flutter.commands, { desc = "Open command Flutter" })
vim.keymap.set("n", "<leader>r", ":FlutterReload<CR>", { silent = true, desc = "Flutter Reload" })
vim.keymap.set("n", "<leader>R", ":FlutterRestart<CR>", { silent = true, desc = "Flutter Restart" })
---jaq-nvim ---jaq-nvim
require("jaq-nvim").setup({ require("jaq-nvim").setup({
cmds = { cmds = {
@ -607,7 +618,6 @@ require("jaq-nvim").setup({
ruby = "ruby %", ruby = "ruby %",
java = "java %", java = "java %",
javascript = "node %", javascript = "node %",
swift = "swift %",
dart = "dart %", dart = "dart %",
}, },
}, },
@ -723,9 +733,12 @@ require("nvim-treesitter.configs").setup({
enable = true, enable = true,
}, },
}, },
yati = { indent = {
enable = true, enable = true,
}, },
yati = {
enable = false,
},
matchup = { matchup = {
enable = true, enable = true,
enable_quotes = true, enable_quotes = true,