Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working/initialize #3

Closed
tredeneo opened this issue Feb 21, 2021 · 9 comments
Closed

not working/initialize #3

tredeneo opened this issue Feb 21, 2021 · 9 comments

Comments

@tredeneo
Copy link

tredeneo commented Feb 21, 2021

the plugin not initializing automatically(LSP,Closing Tags,Outline window) then I run

:FlutterDevTools

I receve this error

flutter-tools.nvim/lua/flutter-tools/dev_tools.lua:12: bad argument #1 to 'ipairs' (table expected, got number)

same result on both linux and windows

linux neovim version:

0.5.0-dev+1101

windows neovim version:

0.5.0-dev+1099

plugin manager:

paq-nvim

my config(init.lua):

https://github.com/tredeneo/configs/blob/main/init.lua

@tredeneo tredeneo changed the title not working not working/initialize Feb 21, 2021
@tredeneo
Copy link
Author

I am reinstall devtools and works, but LSP not yet

@akinsho
Copy link
Owner

akinsho commented Feb 21, 2021

@tredeneo I'm away from my computer right now (on mobile). How have you got flutter set up. It's it in your PATH how did you install it? If you use falls dartls from nvim config on it's own does that work?

@tredeneo
Copy link
Author

tredeneo commented Feb 21, 2021

with dartls also not works

directory flutter on windows(where)

C:\flutter\bin\flutter
C:\flutter\bin\flutter.bat

directory flutter on linux(whereis)

flutter: /snap/bin/flutter.openurl
/snap/bin/flutter.dart
/snap/bin/flutter

after create issue, I have installed dart-sdk(also not works)

directory dart on linux(whereis)

dart: /usr/bin/dart
/usr/lib/dart
/usr/lib/dart/bin/dart
/snap/bin/dart

directory dart on windows(where)

C:\flutter\bin\dart
C:\flutter\bin\dart.bat
C:\tools\dart-sdk\bin\dart.exe

linux PATH

/usr/lib/dart/bin/
/home/tredeneo/.local/bin/
/home/tredeneo/.cargo/bin/
/snap/bin/
/usr/local/sbin
/usr/local/bin
/usr/local/games
/usr/sbin
/usr/bin
/usr/games
/sbin
/bin

windows PATH

C:\Program Files\PowerShell\7;C:\Python39\Scripts;C:\Python39;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\flutter\bin;C:\Program Files\PowerShell\7;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Users\daniel\AppData\Local\Microsoft\WindowsApps;C:\Users\daniel\AppData\Local\Programs\Microsoft VS Code\bin;C:\tools\neovim\Neovim\bin;C:\tools\dart-sdk\bin;C:\Users\daniel\AppData\Roaming\Pub\Cache\bin

obs:
others LSP works(clangd,rls,rust_analyzer)
":FlutterDevices",":FlutterRun" works

@akinsho
Copy link
Owner

akinsho commented Feb 22, 2021

@tredeneo the issue on linux is with how snap install packages, there's some magic complexity in there with symlinks so it doesn't work the same with cli tools such as neovim using jobstart('flutter <cmd>') which is what this plugin does. The solution would be to overwrite the path the lsp. In the case of snap that would be
echo $HOME/snap/flutter/common/flutter/bin/flutter but you need the binary for the lsp server. which would be in that folder area somwhere. You would need to override the cmd for the language server.

regarding windows tbh I don't use windows and can't test windows so I can't explicitly support it, but if people are willing to add functionality for it and test that it works I'd be happy to merge them

@akinsho
Copy link
Owner

akinsho commented Feb 24, 2021

@tredeneo did you manage to get it working? I'm hoping to add instructions for things like snap to the readme

@tredeneo
Copy link
Author

tredeneo commented Feb 24, 2021

I add $HOME/snap/flutter/common/flutter/bin to PATH, and remove flutter link from /snap/bin/ (or rename for "any name")
on windows, not worked I think because flutter was on root directory('C:\'), $User\Documents\flutter works

@mystchonky
Copy link

I made it work in windows by changing this part in lua/flutter-tools/executable.lua to

local M = {
  dart_bin_name = "dart.bat",
}

Virtual Texts, Diagnostics, Completions and outlines, all work!

@akinsho
Copy link
Owner

akinsho commented Sep 30, 2021

@luiq54 is the dart.bat bit necessary for all Windows users or just your setup? I haven't had other Windows users complain as far as I know, so I don't really know if I can safely change that for all Windows users or if it will break a lot of other people's setups

@mystchonky
Copy link

mystchonky commented Oct 1, 2021

The bin folder in flutter sdk has these files
image
dart and flutter are bash scripts while other two are windows batch files. It think it is necessary to use dart.bat in windows.
(I haven't seen a single windows issue except this one so I am very skeptical)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants