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

Create a RunningAzureFunctions class to handle multiple function tasks in one workspace #4320

Merged
merged 10 commits into from
Nov 11, 2024

Conversation

nturinski
Copy link
Member

@nturinski nturinski commented Nov 8, 2024

Previously, there was a limitation of only being able to run one task per workspace. This would make it impossible to run and manage multiple tasks in subfolders which was blocking a scenario for the C# Dev Kit team.

These changes make the workspace folder a key to the map, but we are storing it in an array. The array contains the cwd of the subpath for the project. This will allow us to run multiple projects in different folders simultaneously which should hopefully get us one step closer to monorepo support.

@nturinski nturinski requested a review from a team as a code owner November 8, 2024 01:23

const workspaceFolder = buildPathToWorkspaceFolderMap.get(debugSession.configuration.launchServiceData.buildPath)
if (workspaceFolder === undefined) {
throw Error()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I wasn't sure if throwing here is correct.

Maybe a vscode.window.showWarningMessage('Unable to find workspaceFolder for debugConfiguration.buildPath"); + however its localized


const funcTask = new vscode.Task({ type: `func ${buildPath}` },
workspaceFolder,
hostStartTaskName, `func`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: place on next line since its another argument

const client: SiteClient = await node.site.createClient(context);
await startFuncProcessFromApi(`${workspace.workspaceFolders![0].uri.path}/bin/Debug/net8.0`, [], {});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, will do. Was from testing 😅

workspaceFolder = {
uri: vscode.Uri.parse(buildPath),
name: buildPath,
index: -1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure if the consequences of using index: -1 if VS Code actually looks at this 😓

MicroFish91
MicroFish91 previously approved these changes Nov 8, 2024
Copy link
Contributor

@MicroFish91 MicroFish91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for now so as not to block. Ping if you need review again later

@nturinski nturinski changed the title Nat/running function map array Create a RunningAzureFunctions class to handle multiple function tasks in one workspace Nov 11, 2024
@nturinski nturinski merged commit c2cb7a4 into main Nov 11, 2024
2 checks passed
@nturinski nturinski deleted the nat/runningFunctionMapArray branch November 11, 2024 17:50
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