vscode-hide-gitignored icon indicating copy to clipboard operation
vscode-hide-gitignored copied to clipboard

Plugin incorrectly uses the name of the workspace as the name of the folder

Open laurent22 opened this issue 5 years ago • 0 comments

I have my code-workspace file setup like this:

{
	"folders": [
		{
			"name": "Joplin",
			"path": "."
		},
		{
			"name": "Joplin Nextcloud App",
			"path": "D:/nextcloud/apps/joplin"
		},
	],
	"settings": {
		"files.exclude": {
			// ...
		},
	},
}

So there are two folders, one that's just the current directory . and another one which points to another directory. When I run the Gitignored command, it adds the files like this:

"settings": {
	"files.exclude": {
		"Joplin/node_modules",
		"Joplin/......",
	},
},

So it prefixes all the path with "Joplin/", but that doesn't work because it's not a path but just a workspace name (which can be anything).

For now I've solved it by renaming my workspace to "." like so:

"folders": [
	{
		"name": ".",
		"path": "."
	},
	// ....
],

Not ideal but at least it works as in that case it sets the paths as ./node_modules etc.

So for the plugin I think the solution would be to take the value from the "path" key, and not from the "name" one.

laurent22 avatar Jun 23 '20 16:06 laurent22