Skip to content

Commit a92c62f

Browse files
nturinskiCopilotNathan TurinskiCopilot
authored
Function Host Debugger View (#4883)
* Implementation for debug-isolated flag and streaming func CLI output * Update src/utils/stream.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address copilot feedback * Refactor to set up stream in funcHostTasks * Delete test snippet * Add headerto stream file * Remove the done call * Update src/debug/FuncTaskProvider.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * WIP waiting for VSCode insiders fix * Use onDidStartTerminalShellExecution API instead of proposed * Remove proposed files * Add note * Remove unused async moniker * Whoops, wrong async * Little bit of cleaning * Remove unusued function helper * Last commit, I swears it * Move event handler, added note * Rename function due to PR feedback * Push up WIP * Push up WIP * WIP for postDebug copilot analysis * Add debug command activity * WIP for copilot postdebug * Merge with main * Fix linter * MVP for func debugger view * Setting for debugger view, show first error * Refactoring/cleaning up * Remove the stop action and implement clear errors * Clean up some code * Remove the terminal dispose since it is not reinstantiated later * Update src/funcCoreTools/funcHostTask.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/funcCoreTools/funcHostErrorUtils.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add JSDoc documentation for IStartFuncProcessResult stream property (#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> * Prevent infinite stream iteration when func host task terminates (#4887) * 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> * Update src/debug/FunctionHostDebugView.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove exhaustive check from switch statement Removed exhaustive check for FuncHostDebugNode. * npm install to update package-lock * Convert shell args to be an array * Fix duplicate log entries, fix func start tasks with args not being recognized * Clean up some of the code * Fix imports in tests * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * PR feedback * Debugger view always visible but collapsed by default * Display stopped hosts as well * Expose ask copilot on top level node * Make labels a bit more descriptive * Refactor into individual tree items * Remove enums that are not shared --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Nathan Turinski <naturins@microsoft.comm> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
1 parent 3b53f06 commit a92c62f

20 files changed

+1089
-51
lines changed

package-lock.json

Lines changed: 25 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@
9090
]
9191
}
9292
},
93+
"views": {
94+
"debug": [
95+
{
96+
"id": "azureFunctions.funcHostDebugView",
97+
"name": "%azureFunctions.funcHostDebugView.title%",
98+
"when": "!virtualWorkspace",
99+
"visibility": "collapsed",
100+
"icon": "resources/azure-functions.svg"
101+
}
102+
]
103+
},
93104
"commands": [
94105
{
95106
"command": "azureFunctions.addBinding",
@@ -467,6 +478,36 @@
467478
"command": "azureFunctions.getMcpHostKey",
468479
"title": "%azureFunctions.getMcpHostKey%",
469480
"category": "Azure Functions"
481+
},
482+
{
483+
"command": "azureFunctions.funcHostDebug.refresh",
484+
"title": "%azureFunctions.funcHostDebug.refresh%",
485+
"category": "Azure Functions",
486+
"icon": "$(refresh)"
487+
},
488+
{
489+
"command": "azureFunctions.funcHostDebug.showRecentLogs",
490+
"title": "%azureFunctions.funcHostDebug.showRecentLogs%",
491+
"category": "Azure Functions",
492+
"icon": "$(output)"
493+
},
494+
{
495+
"command": "azureFunctions.funcHostDebug.copyRecentLogs",
496+
"title": "%azureFunctions.funcHostDebug.copyRecentLogs%",
497+
"category": "Azure Functions",
498+
"icon": "$(copy)"
499+
},
500+
{
501+
"command": "azureFunctions.funcHostDebug.askCopilot",
502+
"title": "%azureFunctions.funcHostDebug.askCopilot%",
503+
"category": "Azure Functions",
504+
"icon": "$(sparkle)"
505+
},
506+
{
507+
"command": "azureFunctions.funcHostDebug.clearStoppedSessions",
508+
"title": "%azureFunctions.funcHostDebug.clearStoppedSessions%",
509+
"category": "Azure Functions",
510+
"icon": "$(trash)"
470511
}
471512
],
472513
"submenus": [
@@ -503,9 +544,54 @@
503544
"submenu": "azureFunctions.submenus.workspaceActions",
504545
"when": "view == azureWorkspace",
505546
"group": "navigation@1"
547+
},
548+
{
549+
"command": "azureFunctions.funcHostDebug.refresh",
550+
"when": "view == azureFunctions.funcHostDebugView",
551+
"group": "navigation@1"
552+
},
553+
{
554+
"command": "azureFunctions.funcHostDebug.clearStoppedSessions",
555+
"when": "view == azureFunctions.funcHostDebugView",
556+
"group": "navigation@2"
506557
}
507558
],
508559
"view/item/context": [
560+
{
561+
"command": "azureFunctions.funcHostDebug.showRecentLogs",
562+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.hostTask",
563+
"group": "inline"
564+
},
565+
{
566+
"command": "azureFunctions.funcHostDebug.copyRecentLogs",
567+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.hostTask",
568+
"group": "inline"
569+
},
570+
{
571+
"command": "azureFunctions.funcHostDebug.showRecentLogs",
572+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.stoppedHostTask",
573+
"group": "inline"
574+
},
575+
{
576+
"command": "azureFunctions.funcHostDebug.copyRecentLogs",
577+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.stoppedHostTask",
578+
"group": "inline"
579+
},
580+
{
581+
"command": "azureFunctions.funcHostDebug.askCopilot",
582+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.hostError",
583+
"group": "1@1"
584+
},
585+
{
586+
"command": "azureFunctions.funcHostDebug.askCopilot",
587+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.hostTask",
588+
"group": "1@1"
589+
},
590+
{
591+
"command": "azureFunctions.funcHostDebug.askCopilot",
592+
"when": "view == azureFunctions.funcHostDebugView && viewItem == azFunc.funcHostDebug.stoppedHostTask",
593+
"group": "1@1"
594+
},
509595
{
510596
"command": "azureFunctions.createFunction",
511597
"when": "view == azureWorkspace && viewItem =~ /azFuncLocalProject/i",
@@ -947,6 +1033,22 @@
9471033
{
9481034
"command": "azureFunctions.unassignManagedIdentity",
9491035
"when": "never"
1036+
},
1037+
{
1038+
"command": "azureFunctions.funcHostDebug.refresh",
1039+
"when": "never"
1040+
},
1041+
{
1042+
"command": "azureFunctions.funcHostDebug.showRecentLogs",
1043+
"when": "never"
1044+
},
1045+
{
1046+
"command": "azureFunctions.funcHostDebug.copyRecentLogs",
1047+
"when": "never"
1048+
},
1049+
{
1050+
"command": "azureFunctions.funcHostDebug.askCopilot",
1051+
"when": "never"
9501052
}
9511053
],
9521054
"editor/context": [
@@ -990,6 +1092,12 @@
9901092
"properties": {
9911093
"command": {
9921094
"type": "string"
1095+
},
1096+
"args": {
1097+
"type": "array",
1098+
"items": {
1099+
"type": "string"
1100+
}
9931101
}
9941102
}
9951103
}

package.nls.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,11 @@
144144
"azureFunctions.mcpProjectType": "The type of MCP integration the project uses.",
145145
"azureFunctions.mcpProjectType.NoMcpServer": "Runs the standard Azure Functions runtime with no MCP integration.",
146146
"azureFunctions.mcpProjectType.McpExtensionServer": "Runs the Functions host with an embedded MCP server provided by the Azure Functions MCP extension.",
147-
"azureFunctions.mcpProjectType.SelfHostedMcpServer": "Runs the Functions host in custom-handler mode, forwarding requests to a self-hosted MCP server process."
147+
"azureFunctions.mcpProjectType.SelfHostedMcpServer": "Runs the Functions host in custom-handler mode, forwarding requests to a self-hosted MCP server process.",
148+
"azureFunctions.funcHostDebugView.title": "Functions Host Exceptions Debugger",
149+
"azureFunctions.funcHostDebug.refresh": "Refresh",
150+
"azureFunctions.funcHostDebug.showRecentLogs": "Show Recent Host Logs",
151+
"azureFunctions.funcHostDebug.copyRecentLogs": "Copy Recent Host Logs",
152+
"azureFunctions.funcHostDebug.askCopilot": "Ask Copilot",
153+
"azureFunctions.funcHostDebug.clearStoppedSessions": "Clear Stopped Sessions"
148154
}

src/commands/CommandAttributes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ export class CommandAttributes {
3030
"Task hub creation fails — if an existing parent DTS resource was selected, check that the scheduler is not stuck in a provisioning state.",
3131
],
3232
};
33-
3433
}

0 commit comments

Comments
 (0)