use umbrella root formatter config when present#35
use umbrella root formatter config when present#35superhawk610 wants to merge 2 commits intoremoteoss:mainfrom
Conversation
|
Hi @superhawk610, thank you for the contribution! I would suggest a modification to the approach to handle both umbrella apps and monorepos: Rather than walking up to the umbrella root, we should keep walking up to the project root (which would be the same as the umbrella root in your example). This way we handle monorepos with strange |
|
That makes sense! Does the LSP have access to a project root directory set in the config somewhere, or should we just recurse some arbitrary number of directories upward until we find a EDIT: Ahh, I see
|
|
Thanks @superhawk610! I haven't forgotten about this - I have just been busy with a few other things. Will review sometime this week! |
Closes #34.
Given this file tree:
When formatting
apps/app_web/lib/component.ex, the umbrella root.formatter.exsshould be used.I'm not confident that the approach I took to solve this, namely having
findMixRootreturn(appRoot, umbrellaRoot string), is the best. It requires passing around both the app root and umbrella roots whenever resolving a formatter. It may be easier to identify the correct formatter file earlier and just pass that around instead.