Add flutter config

This commit is contained in:
Grafcube 2024-04-01 20:13:18 +05:30
parent 01ae09d509
commit 74c418ea54
Signed by: grafcube
GPG Key ID: E383688F2878A440
2 changed files with 51 additions and 0 deletions

View File

@ -34,10 +34,16 @@ local config = {
"racket_langserver",
"rust_analyzer",
"clangd",
"dartls",
},
formatting = {
format_on_save = true,
},
setup_handlers = {
dartls = function(_, opts)
require("flutter-tools").setup({ lsp = opts })
end
},
config = {
clangd = {
capabilities = { offsetEncoding = "utf-8" },
@ -60,6 +66,15 @@ local config = {
},
},
},
dartls = {
color = {
enabled = true,
},
settings = {
showTodos = true,
completeFunctionCalls = true,
},
},
slint_lsp = {
root_dir = function() require("lspconfig.util").root_pattern("*") end,
},

View File

@ -395,6 +395,42 @@ return {
},
}
},
{
"akinsho/flutter-tools.nvim",
ft = { "dart" },
dependencies = {
"nvim-lua/plenary.nvim",
"stevearc/dressing.nvim",
},
opts = {
debugger = {
enabled = true,
run_via_dap = true,
register_configurations = function(paths)
require("dap").configurations.dart {
{
type = "dart",
request = "launch",
name = "Launch dart",
dartSdkPath = paths.dart_sdk,
flutterSdkPath = paths.flutter_sdk,
program = "${workspaceFolder}/lib/main.dart",
cwd = "${workspaceFolder}",
},
{
type = "flutter",
request = "launch",
name = "Launch flutter",
dartSdkPath = paths.dart_sdk,
flutterSdkPath = paths.flutter_sdk,
program = "${workspaceFolder}/lib/main.dart",
cwd = "${workspaceFolder}",
}
}
end,
},
},
},
{
"ray-x/lsp_signature.nvim",
config = function()