Skip to content

Conversation

shekhirin
Copy link
Contributor

@shekhirin shekhirin commented Sep 16, 2022

@shekhirin shekhirin marked this pull request as ready for review September 16, 2022 17:26
@shekhirin
Copy link
Contributor Author

@juanfranblanco @fubhy fyi

@juanfranblanco
Copy link
Owner

Thanks :)

@juanfranblanco
Copy link
Owner

@shekhirin
Copy link
Contributor Author

@juanfranblanco oops, yeah, that would definitely work! Fixed.

@juanfranblanco juanfranblanco merged commit 7fc5b97 into juanfranblanco:master Sep 26, 2022
@fubhy
Copy link

fubhy commented Sep 26, 2022

@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 forge config --json command that could be used to load the configuration and determine the source code paths that a particular configuration file is responsible for.

@juanfranblanco
Copy link
Owner

@fubhy vscode supports multiple workspaces, your monorepo can be created that way, workspace per project.

@fubhy
Copy link

fubhy commented Sep 26, 2022

@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 (code -a .).

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).

@fubhy
Copy link

fubhy commented Sep 26, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants