Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ft/vscode-azurefunctions into nat/fileBasedPickProcess
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ft/vscode-azurefunctions into nat/fileBasedPickProcess
…ions into nat/fileBasedPickProcess
…ft/vscode-azurefunctions into nat/fileBasedPickProcess
…ft/vscode-azurefunctions into nat/fileBasedPickProcess
…ions into nat/fileBasedPickProcess
|
@nturinski I've opened a new pull request, #4886, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@nturinski I've opened a new pull request, #4887, to work on those changes. Once the pull request is ready, I'll request review from you. |
…4885) * Initial plan * Add JSDoc documentation for IStartFuncProcessResult interface Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
* Initial plan * Add AbortController to prevent infinite stream iteration Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
|
@nturinski I've opened a new pull request, #4888, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed exhaustive check for FuncHostDebugNode.
src/debug/FuncTaskProvider.ts
Outdated
| const funcCliPath = await getFuncCliPath(context, folder); | ||
| const args = (definition?.args || []) as string[]; | ||
| if (args.length > 0) { | ||
| command = `${command} ${args.join(' ')}`; |
There was a problem hiding this comment.
Since the VSCode Task API accepts argument lists, why not use that?
src/utils/copilotChat.ts
Outdated
| const candidates: Array<{ command: string; args: unknown[] }> = [ | ||
| // Newer VS Code variants | ||
| { command: 'workbench.action.chat.open', args: [trimmed] }, | ||
| { command: 'workbench.action.chat.open', args: [{ query: trimmed }] }, | ||
| // Older / alternate variants | ||
| { command: 'workbench.action.openChat', args: [trimmed] }, | ||
| // Copilot extensions (IDs vary by version) | ||
| { command: 'github.copilot.openChat', args: [trimmed] }, | ||
| { command: 'github.copilot-chat.openChat', args: [trimmed] }, | ||
| ]; |
There was a problem hiding this comment.
Does the minimum VSCode version we have in this extension exclude any of these?
|
Very cool, I have it as a todo to review this either tomorrow or early next week! |
| return tasks; | ||
| } | ||
|
|
||
| async function updateFuncHostDebugContext(): Promise<void> { |
There was a problem hiding this comment.
I'm running into an issue on error where the Function Host Debug view is not showing up. Well, at least that's what it appeared like initially. In reality, after I set some breakpoints, I realized that it actually is getting shown, but then immediately gets hidden.
I think for some reason this update function is called to show the view, and then for some reason gets called again and causes the view to hide.
My repro steps were: (1) create a DTS project via createNewProject, (2) hit F5, and (3) answer skip for now so nothing gets set for both connections. This causes this func CLI error which I was expecting to show up:
I should be in office tomorrow so if you're not able to repro maybe we can investigate on my machine, lmk!
9c7593c to
383bfff
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot Do another PR review |
|
@nturinski I've opened a new pull request, #4928, to work on those changes. Once the pull request is ready, I'll request review from you. |
src/funcCoreTools/funcHostTask.ts
Outdated
| const taskDirectory = taskExecution.options?.cwd?.replace('${workspaceFolder}', (t.taskExecution.task?.scope as vscode.WorkspaceFolder).uri?.path); | ||
| buildPath = buildPath?.replace('${workspaceFolder}', (t.taskExecution.task?.scope as vscode.WorkspaceFolder).uri?.path); | ||
| return taskDirectory && buildPath && normalizePath(taskDirectory) === normalizePath(buildPath); | ||
| const resolvedBuildPath = buildPath?.replace('${workspaceFolder}', (t.taskExecution.task?.scope as vscode.WorkspaceFolder).uri?.path); |
There was a problem hiding this comment.
task.scope can be a TaskScope enum value (just a number), not only a WorkspaceFolder. Casting it here without checking means .uri?.path evaluates to undefined, and String.replace() will happily coerce that to the literal string "undefined" — so you'd end up with paths like /some/path/undefined/sub instead of the original unresolved string.
We already do the right typeof check in registerFunctionHostDebugView.ts, so maybe something like:
const workspacePath = typeof t.taskExecution.task?.scope === 'object'
? (t.taskExecution.task.scope as vscode.WorkspaceFolder).uri?.path
: undefined;
const taskDirectory = workspacePath
? taskExecution.options?.cwd?.replace('${workspaceFolder}', workspacePath)
: taskExecution.options?.cwd;
const resolvedBuildPath = workspacePath
? buildPath?.replace('${workspaceFolder}', workspacePath)
: buildPath;| const funcTaskStartedEmitter = new vscode.EventEmitter<{ scope: vscode.WorkspaceFolder | vscode.TaskScope, execution?: vscode.ShellExecution }>(); | ||
| export const onFuncTaskStarted = funcTaskStartedEmitter.event; | ||
|
|
||
| const runningFuncTasksChangedEmitter = new vscode.EventEmitter<void>(); | ||
| export const onRunningFuncTasksChanged = runningFuncTasksChangedEmitter.event; |
There was a problem hiding this comment.
these emitters are never disposed
There was a problem hiding this comment.
Yeah, the issue is that we need to create them when the extension is activated, and if we dispose them after a function host task is terminated, they never get instantiated again.
I went ahead and disposed them on deactivation, which I think should happen anyway, but just to be explicit.
This PR adds a Function Host Debug view to the Azure Functions extension. The view appears in the Run and Debug panel and lists running Function Host tasks along with their recent error output.
A new tree view provider backs this view and supplies nodes for active hosts and error entries. The view includes commands to refresh the data, clear recorded errors, view or copy recent logs, and send an error to Copilot. These commands are available from the view toolbar and node context menus.
The PR also introduces a setting to always show the Function Host Debug view, regardless of context.
Supporting changes include exporting shared utilities for identifying host error logs and cleaning log output, extending command handling to accept argument arrays, and updating the Functions task provider to allow additional CLI arguments in task definitions.
No host running (only visible if always show setting is enabled)

Function host running with no errors

Function host running with an error

Location of Ask Copilot context menu
