Code Monkey home page Code Monkey logo

Comments (13)

iamcco avatar iamcco commented on June 19, 2024

It's because coc.nvim will add workspace change when go to the sdk directory, and there's no .dart_tool info of that package. I will fix it do not send workspace change when go to sdk directory.

from coc-flutter.

Kavantix avatar Kavantix commented on June 19, 2024

@iamcco thanks for the quick response.
This seems to fix the cases when looking at code in the sdk.
However, other libraries still show the same behaviour.

from coc-flutter.

iamcco avatar iamcco commented on June 19, 2024

Use "flutter.workspaceFolder.ignore": [] options.

from coc-flutter.

Kavantix avatar Kavantix commented on June 19, 2024

Can you give me an example of how to use it for a package in the .pub_cache folder.
Already tried a lot of possibilities but non work.

Also, the option gives a warning that it expects type string instead of string[]

from coc-flutter.

iamcco avatar iamcco commented on June 19, 2024

"flutter.workspaceFolder.ignore": ["~/xxx/xxx"] path start with ~/xxx/xxx will not change workspace folder.

from coc-flutter.

iamcco avatar iamcco commented on June 19, 2024

Also you can improve it if you have any good idea.

from coc-flutter.

Kavantix avatar Kavantix commented on June 19, 2024

If I understand correctly then the default should actually work for me since the default ignored path ends up being .../flutter since the flutter binary is at .../flutter/bin/flutter and the pubcache folder which holds all dependencies is at .../flutter/.pub_cache`

However, its still not finding those dependencies so I'm not sure that changing workspace folder is what is causing this issue although at least now files in the sdk don't have errors all over

Don't have any ideas looking at the code how to fix it atm.

from coc-flutter.

iamcco avatar iamcco commented on June 19, 2024

Dart LSP use project .dart_tool packages info to resolve dependence, so if your lib package do not run flutter packages get it will not have the dependence info. so if goto lib file and coc.nvim change workspace to lib directory it can't resolve dependence. if your lib is in flutter sdk directory, it should not have the problem. i don't know what happend.

debug at https://github.com/iamcco/coc-flutter/blob/master/src/server/lsp/index.ts#L97

from coc-flutter.

Kavantix avatar Kavantix commented on June 19, 2024

Running pub get in the package's directory indeed resolves this.
Would there be any way we could automatically do this?

It is also still interesting that the vscode extensions does not need to do this even when running it using the LSP

from coc-flutter.

iamcco avatar iamcco commented on June 19, 2024

I don't have the issue, you can debug with above response.

from coc-flutter.

PangPangPangPangPang avatar PangPangPangPangPang commented on June 19, 2024

Encountered exactly the same problem. And SDK directory still show errors.

from coc-flutter.

wangzhaohe avatar wangzhaohe commented on June 19, 2024

Encountered exactly the same problem. And SDK directory still show errors.

from coc-flutter.

wangzhaohe avatar wangzhaohe commented on June 19, 2024

Running pub get in the package's directory indeed resolves this. Would there be any way we could automatically do this?

It is also still interesting that the vscode extensions does not need to do this even when running it using the LSP

I open a new issue, then I found the discuss here.

#150 (comment)

Would you teach me how to solve this problem? Wish your help, thanks.

Now I make a link to .dart_tool, but there are many 3rd libs. So I think it is not a good method.

from coc-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.