Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: do not start new lsp client for flutter dependency
  • Loading branch information
sidlatau committed Jun 29, 2025
commit ce7e89a64166eeecc8d7576632295d542c0b722e
14 changes: 8 additions & 6 deletions lua/flutter-tools/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ end
function M.get_project_root_dir()
local conf = require("flutter-tools.config")
local current_buffer_path = path.current_buffer_path()
local root_path = lsp_utils.is_valid_path(current_buffer_path)
and path.find_root(conf.root_patterns, current_buffer_path)
or nil

if root_path ~= nil then return root_path end

-- Check if path is flutter dependency. For dependencies we do not
-- search for a root directory as they are not projects.
if not path.is_flutter_dependency_path(current_buffer_path) then
local root_path = lsp_utils.is_valid_path(current_buffer_path)
and path.find_root(conf.root_patterns, current_buffer_path)
or nil
if root_path ~= nil then return root_path end
end
local client = lsp_utils.get_dartls_client()
return client and client.config.root_dir or nil
end
Expand Down
Loading