question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multi-root workspaces - SDK paths

See original GitHub issue

Splitting this from #453 because it may result in much discussion!

Currently we have some flags that say whether we’re a Flutter/Fuchsia project and we use them to influence the search paths for SDKs. With multi-roots, we might have a Flutter and a standard Dart project loaded (or even multiple of each). This raises some interesting questions… If I open a project that has three workspace folders like this:

  • Dart frontend website
  • Flutter mobile app
  • Dart web server app (used as API for mobile app and website)

What do we do to pick the SDK location? Do we just pick the “best” (eg. in this case, Flutter wants a specific SDK so we use that for the Dart projects too?). Is it safe to just have a preference like this? If we end up with a Fuchsia and Flutter project, is it safe to use either of those for the other?

If this isn’t safe and we decide that we should use multiple SDKs (spawning multiple analysers), what about places that need to know the SDK that don’t have the context of a folder (for example the user initiates pub get from the command palette)? Would spawning multiple analysers introduce other issues (not being able to navigate between them or excessive resource usage?)

What about if there are multiple Flutter projects? How do we get a device list? Where do we run Flutter from? Is it reasonable to just refuse to load multiple Flutter projects? What about if people have two related apps and want to work on them together?

Probably we don’t need to worry about Fuchsia + Flutter projects for now so probably we can just refuse to load Fuchsia in the presence of another Flutter app (this might not be reasonable in the future, but until more is known about Fuchsia I have no idea).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Nov 25, 2017

Two flutter projects should be simpler. The device list would be identical for both

I just checked, and flutter daemon seems to work outside of a project folder; so I think this actually will be easy too - I can just run it from whichever SDK we settled on and not have to worry about it being per-project 😃

I’m just not sure how well the single analyzer would handle both projects simultaneously.

I’m not sure what you mean here - I think the analyser works fine for multiple projects (I can provide it an array of roots; though it also already walks down figuring out which folders inside those may be their own roots - with one exception).

0reactions
DanTupcommented, Nov 28, 2017

@devoncarew Thanks! This is what I’ve done and it seems to be working. There’s the possibility of strange things happening if you open multiple project types together (eg. Fuchsia + Flutter) and you have something relying on a specific version (eg. your Flutter project needs latest Flutter but Fuchsia is shipping an older version) but I think that’s an edge case we probably don’t need to worry about (the probability of the few people using DC for Fuchsia also working on a mobile Flutter app and need bleeding edge seems very low!).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-root Workspaces in Visual Studio Code
Workspace file schema. The schema of .code-workspace is fairly straightforward. You have an array of folders with either absolute or relative paths. Relative ......
Read more >
Support for multi-root workspaces without extraPaths ... - GitHub
I work in a project that has multiple components written in Python each in its own Git Repository. Each component gets built into...
Read more >
Visual Studio Code tips for monorepo development with Multi ...
A multi-root workspace is a feature in Visual Studio Code where you can have multiple root folders in one explorer view.
Read more >
vscode multiroot workspace path environment variable
I am using trying to use cpptools extension for intellisense and other functionality. I would like to set default include paths at the...
Read more >
v2.6 - Dart Code - Dart & Flutter support for Visual Studio Code
VS Code 1.18 gained support for multi-root workspaces, which allows multiple ... SDK search paths have been simplified to make them easy to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found