emacs-lsp/lsp-dart

Get many error after jump into current project dependency libraries with lsp-ui-peek-find-definitions.

zw963 opened this issue · 5 comments

zw963 commented

Describe the bug
We use library, named. infinite_scroll_pagination, I can jump to following page successful when i run lsp-ui-peek-find-definitions
on PagedChildBuilderDelegate class, this was expected. but after jump into this file, that is.

/home/zw963/.pub-cache/hosted/pub.flutter-io.cn/infinite_scroll_pagination-3.1.0/lib/src/core/paged_child_builder_delegate.dart:13

I get many errors, which cause jump to other definition in this file not possible, because those definition not found, need be defined.

image

But continue to jump works quite well when use with code.

BTW: i can always jump to file defined on my own project, and jump again, that works.

zw963 commented

Even somethings broken when i jump to any dependency libraries, even on the entry file.

image

Was somethings config wrong?

 ╰─ $ flutter --version
Flutter 2.8.1 • channel unknown • unknown source
Framework • revision 77d935af4d (8 weeks ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1
 ╰─ $ cat pubspec.yaml |egrep 'infinite|graphql'
  graphql_flutter: ^5.0.0
  infinite_scroll_pagination: ^3.1.0

I think this happens because you didn't imported the project root with lsp-mode when you entered that file, try lsp-workspace-folders-remove and lsp on that file

zw963 commented

you didn't imported the project root

What you means of project root is for which one? my working on project, or the library?

the working project, the one lsp-mode set and send to server when initializing, you can check

zw963 commented

the working project, the one lsp-mode set and send to server when initializing, you can check

I don't know why, after i fallback to keep (setq lsp-auto-guess-root nil) use default value, it start to work.

thank you very much.