You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dkbast Have the similar issue but workaround well as the following:
make the package be the local dependency of the example project, you may configure like ../ on dependency_overrides to the pubspec of example.
cd to example dir in your terminal emulator.
open vim/nvim editor without args.
:e lib/main.dart (In my experience it must firstly open one dart file which belongs to example project, otherwise the lsp doesn't work well for dart files of example project if you open a dart file of package project at once)
At last, with cocconfig I mentioned above, you will see the lsp works both in example and package project.
Finally, I found another way to work properly without cd into the example folder:
Background:
The whole project structure may be like:
Since default rootPatterns of workspace when you open dart files is like:
{"global": [".git", ".hg", ".projections.json"], "buffer": [], "server": ["pubspec.yaml"]}
Coc.nvim recognize workspaces by this patterns when you once open a file.
By default, when opening example/lib/main.dart from package project root path, Coc use up-bottom mode to specify the workspace, which only treats the package project root path as the workspace rather than the example folder, which causes commands such as flutter.run cannot found the entry lib/main.dart file, even though you append args -t example/lib/main.dart.
Enter (neo)vim from package project root path, then open a dart file or yaml file under example folder, then the flutter commands works well.
But there is an issue left:
Since no exclusive config for rootPattern of coc's workspace and flutter.workspaceFolder.ignore is not be passed to the coc's LanguageClient, the CocList files/grep -workspace includes the unexpected files in workspace folders that should also be ignored.
For example:
As the setting is
The text was updated successfully, but these errors were encountered:
changyiyao
changed the title
[feature] let flutter.workspace.ignore pass to ignoredRootPaths of LanguageClientOptions
[Feature] let flutter.workspace.ignore pass to ignoredRootPaths of LanguageClientOptions
Sep 23, 2021
Finally, I found another way to work properly without
cd
into theexample
folder:Background:
The whole project structure may be like:
Since default rootPatterns of workspace when you open dart files is like:
{"global": [".git", ".hg", ".projections.json"], "buffer": [], "server": ["pubspec.yaml"]}
Coc.nvim recognize workspaces by this patterns when you once open a file.
By default, when opening example/lib/main.dart from package project root path, Coc use up-bottom mode to specify the workspace, which only treats the package project root path as the workspace rather than the example folder, which causes commands such as
flutter.run
cannot found the entry lib/main.dart file, even though you append args-t example/lib/main.dart
.To solve the issue:
But there is an issue left:
Since no exclusive
config
for rootPattern of coc's workspace andflutter.workspaceFolder.ignore
is not be passed to the coc's LanguageClient, theCocList files/grep -workspace
includes the unexpected files in workspace folders that should also be ignored.For example:
As the setting is
The ~/.pub-cache/** should be expected excluded when
CocList -workspace files/grep
, which is still treated as coc's workspace folder.Request:
pass flutter.workspaceFolder.ignore to ignoredRootPath
Originally posted by @changyiyao in #134 (comment)
The text was updated successfully, but these errors were encountered: