-
Notifications
You must be signed in to change notification settings - Fork 203
feat(client, formatter): set forge fmt cwd to respect foundry.toml #363
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
feat(client, formatter): set forge fmt cwd to respect foundry.toml #363
Conversation
Thanks :) |
@juanfranblanco oops, yeah, that would definitely work! Fixed. |
@shekhirin Thanks for highlighting this. This is definitely not within the scope of this small change but in general I think it would be great if this vscode extension would pre-detect project scopes within a workspace and establish a relationship between source code paths and the project configuration (e.g. a foundry.toml) that it is owned by. That way, instead of assuming that there's a foundry.toml at the root of a project, we could also make this (and other utilities) work in monorepos with possibly multiple foundry.toml files or those where the foundry.toml is not at the root. There's already a |
@fubhy vscode supports multiple workspaces, your monorepo can be created that way, workspace per project. |
True, but very few projects currently use multi-root workspaces (or rather, have the configuration for it commited into the repository). And that might also be because navigating a multi-root workspace takes some time to get used to I'd imagine. I personally prefer simply navigating the actual file tree and am normally only (ab)using the multi-root workspace capabilties to simply add folders to the active window ( It might be a matter of taste / getting used to, but currently I don't see myself configuring and navigating a single monorepo as a multi-root workspace just to get the config loading to work in the way I'd expect if that makes sense? I just can't seem to get used to it (and I've tried that for quite some time in the past). |
In this particular case, for instance, it just seems a bit odd that the way I choose to open the project layout in the editor would have an impact on how it formats my code (e.g. with format-on-save enabled). Is that just me? |
#359 (comment)