Flow-for-vscode: Allow for multi-root workspaces

Created on 8 Jan 2019  路  12Comments  路  Source: flowtype/flow-for-vscode

Hi there!

I have seen a few related issues (#201 #302 etc) on the lack of multi-root support and I was wondering if there was any active development going on about this? This is not to complain but I thought it would be nice to have an umbrella issue that people can subscribe to in regards to updates about this feature.

I am open to work on this a bit but I am not super familiar with this project's code base. Are there any maintainers that can point to if anyone is actively working on this, now that LSP support is default? And are there any concerns or gotchas that are preventing this from happening?

Here are some related documents:

Most helpful comment

I was wondering if there was any active development going on about this

Yes but it's not pushed. Most of the implementation is done and will be added soon. Also, can you share some sample repo for your use case. I want to make sure we cover all common use cases.

I thought it would be nice to have an umbrella issue

There is already #243 issue but it's very old and contains other feature also. We can keep this issue open and use it for tracking this feature.

All 12 comments

I was wondering if there was any active development going on about this

Yes but it's not pushed. Most of the implementation is done and will be added soon. Also, can you share some sample repo for your use case. I want to make sure we cover all common use cases.

I thought it would be nice to have an umbrella issue

There is already #243 issue but it's very old and contains other feature also. We can keep this issue open and use it for tracking this feature.

I cannot share my repos but I can definitely describe it: what I have is workspace with multiple projects: some are not in JS, some use flow version A, some dont use flow, some use flow version B. All my flowconfigs are in the root of the project. So something like this

Workspace

/projectA         <--- javascript project with flow version X.X
   /src               <--- all files are in here
   /.flowconfig  <--- flow config relevant to projectA

/projectB         <--- javascript project with flow version Y.Y
   /src               <--- all files are in here
   /.flowconfig  <--- flow config relevant to projectB

/projectC         <--- javascript project without flow
   /src               <--- all files are in here

/projectD         <--- non-javascript project 
   /src               <--- all files are in here

Does that make sense? So when switching from project A to project C, flow should be disabled. And when switching from project B to A (or vice versa) the flow version and config should change as well

Thanks for sharing. Your case is already handled.

Amazing. Thanks @Mayank1791989 - looking forward to try it out :-)

I can鈥檛 wait to try this out as well. This is the one thing blocking me from enabling workspaces in VSCode.

@Mayank1791989 will it also support cases where the project is using Lerna or Yarn Workspaces?

packages/
  pkg1/
    /src
    .flowconfig
  pkg2/
    /src
    .flowconfig
  pkg/
    /src
    # no .flowconfig

@FezVrasta Basically in the new implementation I create (lazily) one client per flowconfig and manages them. So, If flow works in your use case then this plugin will support it. I am going to open PR this weekend so please share some GitHub sample repo, I will test this plugin against it.

Thanks for the reply, unfortunately I don't think I'll be able to publish anything, but I'll make sure to test it once released.

@Mayank1791989 do you have an ETA? If you create a PR I would try it out :)

Excited to see this feature is nearly ready! Something that will come in very handy for me and my team

+1 to this getting merged!

fixed in v1.1.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dominictwlee picture dominictwlee  路  5Comments

lukebarton picture lukebarton  路  5Comments

FezVrasta picture FezVrasta  路  5Comments

Eugene-Musika-cpamatica picture Eugene-Musika-cpamatica  路  6Comments

booboothefool picture booboothefool  路  4Comments