akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Wrapping of widgets doesnt take place

ShobhanKarthick opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In the Flutter Outline, I can see the tree strcuture of widgets and on pressing a, it opens up a plenary window where in I can choose an option as shown in the below figure.
image


But, on pressing any of the option, nothing happens. Any idea why?

Below is the configuration pls help me out

require("flutter-tools").setup {
  ui = {
    border = "rounded",
    notification_style = 'native',
  },
  debugger = { -- integrate with nvim dap + install dart code debugger
    enabled = true,
    run_via_dap = true, -- use dap instead of a plenary job to run flutter apps
    -- if empty dap will not stop on any exceptions, otherwise it will stop on those specified
    -- see |:help dap.set_exception_breakpoints()| for more info
    exception_breakpoints = {}
    --[[ register_configurations = function(paths) ]]
    --[[   require("dap").configurations.dart = { ]]
    --[[     <put here config that you would find in .vscode/launch.json> ]]
    --[[   } ]]
    --[[ end, ]]
  },
  flutter_path = "/opt/flutter/bin/flutter",
  widget_guides = {
    enabled = true,
  },
  dev_log = {
    enabled = true,
    notify_errors = true, -- if there is an error whilst running then notify the user
    open_cmd = "tabedit", -- command to use to open the log buffer
  },
  outline = {
    open_cmd = "30vnew", -- command to use to open the outline buffer
    auto_open = true -- if true this will open the outline automatically when it is first populated
  },
  lsp = {
    color = { -- show the derived colours for dart variables
      enabled = true, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
      background = true, -- highlight the background
      background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},)
      foreground = false, -- highlight the foreground
    },
    on_attach = my_custom_on_attach,
    capabilities = my_custom_capabilities, -- e.g. lsp_status capabilities
    -- see the link below for details on each option:
    -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration
    settings = {
      showTodos = true,
      completeFunctionCalls = true,
      analysisExcludedFolders = {"/home/lsw/.Android/Sdk"},
      renameFilesWithClasses = "prompt", -- "always"
      enableSnippets = true,
      updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command.
    }
  },
}

Expected Behavior

On clicking an option from the plenary window, the widgets are supposed to be wrapped!!

Steps To Reproduce

...

Environment

- OS: Arch Linux
- Flutter version:
- Is flutter in $PATH: YES
- neovim version: 0.9

Anything else?

No response

commented

@ShobhanKarthick I'm in the process of deprecating the code actions in the flutter outline window. Please just use code actions in the actual code instead

@akinsho How exactly am I supposed to do that? Sorry if that is too obvious of an answer :)

commented

@ShobhanKarthick that is really kind of a big question since I think it means you maybe have not setup the language server commands like code actions and diagnostics etc. to answer that would essentially need a walkthrough of some kind which is way beyond an issue in this repo. I'm assuming you are somewhat new to neovim or at least the lsp world of neovim so I suggest going to the section of the README that says are you new to neovim lsp and read the linked README for nvim-lspconfig. That explains how to setup your neovim to do stuff like open code action windows

@ShobhanKarthick Hey dude, if you were able to solve the problem, how did you do it?