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

Use gd coc-definition jump into 3rd plugin showing Target of URI doesn't exist #150

Open
wangzhaohe opened this issue Jan 23, 2022 · 5 comments

Comments

@wangzhaohe
Copy link

wangzhaohe commented Jan 23, 2022

It do well in flutter project, But display diagnostic error in 3rd party plugins like Provider after I used command gd (coc-definition) to jump into the source file.

import 'package:provider/provider.dart';
...
Provider.of<ConversionModel>(context, listen: false)
    .setConversionList(conversationList);

To Reproduce

  1. put cursor on Provider

  2. press gd key

  3. jump into file: "~/learn/flutter/soft/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.1/lib/src/provider.dart"

  4. then error displayed

    import 'package:collection/collection.dart'; >>> Target of URI doesn't exist ...

Screenshots

The following image is in my project, it is right!

image

The following image shows error after jump into provider.dart

Untitled

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Neovim: v0.6.1

Output channel:

  1. Set "flutter.trace.server": "verbose"
  2. Restart coc using :CocRestart
  3. Reproduce the issue
  4. :CocCommand workspace.showOutput open output list and select flutter

Paste Log from above:

[dev-command]: register dev command
[sdk]: No local fvm sdk
[sdk]: which flutter command => /Users/swot/learn/flutter/soft/flutter/bin/flutter
[sdk]: /Users/swot/learn/flutter/soft/flutter/version => 2.5.3
[sdk]: searchPaths: ~/snap/flutter/common/flutter
[sdk]: flutter command path => /Users/swot/learn/flutter/soft/flutter/bin/flutter
[sdk]: dart sdk home => /Users/swot/learn/flutter/soft/flutter/bin/cache/dart-sdk
[sdk]: analyzer path => /Users/swot/learn/flutter/soft/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot
[sdk]: dart command path => /Users/swot/learn/flutter/soft/flutter/bin/cache/dart-sdk/bin/dart
[fs]: executing command /Users/swot/learn/flutter/soft/flutter/bin/cache/dart-sdk/bin/dart --version
[sdk]: dart version: v2.14.4
[lsp-server]: rightVersion true
[lsp-server]: analysis server ready!
[lsp-closing-labels]: register closing labels
[daemon]: got message: {
  "event": "daemon.connected",
  "params": {
    "version": "0.6.1",
    "pid": 21029
  }
}
[daemon]: got message: {
  "event": "daemon.logMessage",
  "params": {
    "level": "status",
    "message": "Starting device daemon..."
  }
}
[daemon]: got message: {
  "id": 1
}
[daemon]: Message without event
[daemon]: got message: {
  "event": "device.added",
  "params": {
    "id": "emulator-5554",
    "name": "sdk gphone x86",
    "platform": "android-x86",
    "emulator": true,
    "category": "mobile",
    "platformType": "android",
    "ephemeral": true,
    "emulatorId": "Pixel_2_API_30"
  }
}
[daemon]: New device: sdk gphone x86
[daemon]: got message: {
  "event": "device.added",
  "params": {
    "id": "chrome",
    "name": "Chrome",
    "platform": "web-javascript",
    "emulator": false,
    "category": "web",
    "platformType": "web",
    "ephemeral": false,
    "emulatorId": null
  }
}
[daemon]: New device: Chrome

I think whether the path settings right or not?

Please give me some advice, thanks a lot!


Some notes:

  1. test in vscode: OK
  2. test in Android Studio: OK
  3. test in intelliJ IDEA CE: OK

The following image is in intellJ IDEA, it is OK!

image

The following operation took no effect:

 "flutter.workspaceFolder.ignore": [
    "/Users/swot/learn/flutter/soft/flutter/.pub-cache/hosted/pub.dartlang.org/",
    "/Users/swot/learn/flutter/soft/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.1/",
    "~/.pub-cache/"
]
flutter packages get
@wangzhaohe wangzhaohe changed the title Use gd coc-definition jump into 3rd plugin showind Target of URI doesn't exist Use gd coc-definition jump into 3rd plugin showing Target of URI doesn't exist Jan 23, 2022
@Kavantix
Copy link
Collaborator

@wangzhaohe do you still have this with the latests version of dart?

@justjew
Copy link

justjew commented Jun 1, 2022

@wangzhaohe do you still have this with the latests version of dart?

I do

@justjew
Copy link

justjew commented Jun 6, 2022

CocDiagnostics shows hundreds of Target of URI doesn't exist

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3

node version: v15.5.0
coc.nvim version: 0.0.81-093e4300 2022-06-04 17:10:20 -0700
term: iTerm.app
platform: darwin

coc.flutter 1.9.8

@Kavantix
Copy link
Collaborator

Kavantix commented Sep 8, 2022

@justjew can you share your settings for coc-flutter

@AdrienLemaire
Copy link

Same issue here, can't navigate further after entering 3rd plugins files, and I'm using the default settings.
Is coc-flutter trying to get the repo packages from the pubspec.yaml or something? Wondering why it can find a package from my repo, but not from a file nested in ~/.pub-cache/hosted/.
The problem only affects imports starting with package:, other imports like dart: work fine.

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

4 participants