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] dartls does not work inside Flutter framework repository

wzslr321 opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have configured my Flutter environment with Lunarvim and flutter-tools plugin. Everything works great on daily basis, but when I want to deep dive inside Flutter's framework code, I get an error while trying to use LSP functions like hover: dartls -32007: File is not being analyzed. LSP dartls shows properly in the bottom right corner, like it's working. I tried to open the flutter files in different ways - directly/through lvim . and file explorer/finding test and opening file etc. Nothing works - I can't use LSP inside any flutter framework file.

Expected Behavior

I would like it to work inside flutter framework files, like in any other dart files.

Steps To Reproduce

On MacOS Ventura 13.4 with

lvim --version
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

Plugin: { 'akinsho/flutter-tools.nvim' }

Inside flutter framework files, cloned from GitHub https://github.com/flutter/flutter.

Environment

- OS:MacOS Ventura 13.4
- Flutter version:3.10.3 (stable)
- Is flutter in $PATH: Yes
- neovim version: v0.9.1

Anything else?

Zrzut ekranu 2023-06-22 o 08 52 52
commented

@wzslr321 by default the plugin puts flutter framework files into the analysis excluded folders as they often have hundreds of diagnostics and other things so are intensive to process

NOTE: By default this plugin excludes analysis of the packages in the flutter SDK. If for example you jump to the definition of StatelessWidget, the lsp will not try and index the 100s (maybe 1000s) of files in that directory. If for some reason you would like this behaviour set analysisExcludedFolders = {} You cannot/should not edit the files in the sdk directly so diagnostic analysis of these file is pointless.

The following is from the configuration section of the README. You can reset the excluded folders and see if that solves your issue.

It worked, I am sorry @akinsho for the redundant issue. I looked at the configuration section of README but I didn't notice this note. Thank you for your quick answer