akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp
MIT License
932 stars 75 forks source link

[BUG] flutter-tools in Lazy.nvim #345

Closed XNeyMo closed 2 weeks ago

XNeyMo commented 2 months ago

Is there an existing issue for this?

Current Behavior

I followed the documentation in the README, however I am unable to use the commands in Flutter. I just copy and paste the code into the documentation, my init.lua is:

required('lazy').setup({
        ...
        {
                'akinsho/flutter-tools.nvim',
                lazy = false,
                dependencies = {
                        'nvim-lua/plenary.nvim',
                        'stevearc/dressing.nvim', -- optional for vim.ui.select
                },
                config = true,
        },

        'nvim-lua/plenary.nvim',
        'stevearc/dressing.nvim'
        ...
},

Expected Behavior

Be able to use Flutter commands

Steps To Reproduce

  1. In lazy.nvim, add flutter-tools.nvim
  2. Reload nvim to install flutter-tools
  3. Error with :FlutterRun (E492: Not and editor command: FlutterRun)

Environment

- OS: Arch Linux 6.8.5
- Flutter version: 3.19.5
- Is flutter in $PATH: yes
- neovim version: 0.9.5

Anything else?

No response

JordanllHarper commented 1 month ago

Might be useful posting your full lazy here, as there doesn't look to be anything wrong initially. What happens if you replace your config with

config  = function() 
    require 'flutter-tools'.setup()
end
JordanllHarper commented 1 month ago

Also just a thought, have you tried in a flutter project? Do you get the commands then?

mbpowers commented 1 month ago

your config works fine for me :thinking:

erlangparasu commented 4 weeks ago

This lua file works for me:

image
return {
    'akinsho/flutter-tools.nvim',
    lazy = true,
    ft = {
        "dart",
    },
    dependencies = {
        'nvim-lua/plenary.nvim',
        'stevearc/dressing.nvim' -- optional for vim.ui.select
    },
    config = true
}
sidlatau commented 2 weeks ago

It looks like this is not a plugin issue, closing it.