Skip to content
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

Can't ignore projects in a multi-project workspaces #959

Closed
gmccullo opened this issue Mar 25, 2022 · 5 comments
Closed

Can't ignore projects in a multi-project workspaces #959

gmccullo opened this issue Mar 25, 2022 · 5 comments

Comments

@gmccullo
Copy link

Describe the bug

I have a multi-project workspace. I only want Foam active in one project. Presumably I can use foam.files.ignore to achieve this. But I can't find any glob pattern that does the trick. Here's my workspace:

{
	"folders": [
		{
			"name": "Notes",
			"path": "Notes"
		},
		{
			"name": "mss",
			"path": "mss"
		},
		{
			"path": "publishing"
		},
		{
			"path": "compile"
		},
		{
			"path": "analyzers"
		}
	],
}

I started out just trying to ignore the /mss/ project. Here's all the globs I tried:

	"foam.files.ignore": [
		"${projectRoot}/mss/**/*",
		"${projectRoot}/**/mss/**/*",
		"**/mss/**/*",
		"mss/**/*",
		"mss/**",
	],

But I still see files from /mss/ show up in the Orphans panel.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

Create a multi-project workspace. Make sure each project contains at least one unlinked markdown file. Try to make Foam ignore one of the projects. See if files from that project are ignored in the Orphans panel.

Expected behavior

Foam should ignore all files /mss/.

Screenshots or Videos

No response

Operating System Version

Win11

Visual Studio Code Version

1.65.2

Additional context

No response

@riccardoferretti
Copy link
Collaborator

Thanks @gmccullo could you please create a small zip file with a small repo to make sure we can reproduce the issue?

@gmccullo
Copy link
Author

Thanks @gmccullo could you please create a small zip file with a small repo to make sure we can reproduce the issue?

foam bug.zip

@riccardoferretti
Copy link
Collaborator

From the logs it's clear what's happening, the ignore patterns are added on top of all the base directories.
This makes sense in the context when Foam is used in a single directory set up, I can see how it becomes limiting in multi-repo setups

Foam Logging: info
[info - 6:41:42 PM] Starting Foam
[info - 6:41:42 PM] Workspace folders: 
[
  "/Users/riccardo/Downloads/foam bug/foam_off",
  "/Users/riccardo/Downloads/foam bug/foam_on"
]
[info - 6:41:42 PM] Glob patterns
{
  "includeGlobs": [
    "/Users/riccardo/Downloads/foam bug/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/*"
  ],
  "ignoreGlobs": [
    "/Users/riccardo/Downloads/foam bug/foam_off/**/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/${projectRoot}/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/${projectRoot}foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/foam_off/**",
    "/Users/riccardo/Downloads/foam bug/foam_off/foam_off/*",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/.git",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/.svn",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/.hg",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/CVS",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/.DS_Store",
    "/Users/riccardo/Downloads/foam bug/foam_off/**/Thumbs.db",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/${projectRoot}/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/${projectRoot}foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/foam_off/**/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/foam_off/**",
    "/Users/riccardo/Downloads/foam bug/foam_on/foam_off/*",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/.git",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/.svn",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/.hg",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/CVS",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/.DS_Store",
    "/Users/riccardo/Downloads/foam bug/foam_on/**/Thumbs.db"
  ]
}
[info - 6:41:42 PM] Found: file:///Users/riccardo/Downloads/foam%20bug/foam_off/foam_off.md
[info - 6:41:42 PM] Found: file:///Users/riccardo/Downloads/foam%20bug/foam_on/foam_on.md
[info - 6:41:42 PM] Loaded 2 notes

@Acumane
Copy link

Acumane commented Oct 11, 2022

Having the same issue. Not sure what else I can provide other than corroborate

@riccardoferretti
Copy link
Collaborator

Thanks, I actually think we have a good approach to solving this issue, I will try to include it in the next release.

Linking to #1065 and #1063

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

No branches or pull requests

3 participants