microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
290 stars 131 forks source link

Function projects inside build output should be ignored #4094

Open Sharparam opened 3 months ago

Sharparam commented 3 months ago

When opening a repository that only has a single function project in it, the extension will still claim that there are multiple.

image

It turns out that this is because it detects build outputs as being function projects:

image

Only the second line in that screenshot is the actual function project, the rest is just the build outputs or artifacts (all of those folders are gitignored).

There doesn't seem to be an option to set up paths that should be ignored by the extension when detecting projects. It would be great if the extension would either honor .gitignore or have an option to set path patterns that should be ignored when searching for projects.

nturinski commented 2 months ago

Hi @Sharparam

Could you try using this setting? "azureFunctions.projectSubpath": "The default subpath of a workspace folder to use for project operations. This is only necessary if you have multiple projects in one workspace. See https://aka.ms/AA4nmfy for more information.",

You can edit your workspace settings by going to .vscode/settings.json or pressing F1 > Preferences: Open Workspace Settings. You can see an example here

Sharparam commented 2 months ago

The problem is that function projects are not on the same sub path, each repository has a differently named function project (src/Org.ProjectName.Functions), so you'd end up having to manually configure it in each project anyway (which is a one-time thing to do, sure, but still a bit of an annoyance when logically there is only one functions project).

The wiki is talking about multi-function project workspaces, which isn't what we're dealing with (we only have one function project per repository/workspace, but it's incorrectly detecting build output as being projects).