MCPcopy
hub / github.com/codeaashu/claude-code / getDiagnosticAttachments

Function getDiagnosticAttachments

src/utils/attachments.ts:2854–2877  ·  view source on GitHub ↗
(
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

2852}
2853
2854async function getDiagnosticAttachments(
2855 toolUseContext: ToolUseContext,
2856): Promise<Attachment[]> {
2857 // Diagnostics are only useful if the agent has the Bash tool to act on them
2858 if (
2859 !toolUseContext.options.tools.some(t => toolMatchesName(t, BASH_TOOL_NAME))
2860 ) {
2861 return []
2862 }
2863
2864 // Get new diagnostics from the tracker (IDE diagnostics via MCP)
2865 const newDiagnostics = await diagnosticTracker.getNewDiagnostics()
2866 if (newDiagnostics.length === 0) {
2867 return []
2868 }
2869
2870 return [
2871 {
2872 type: 'diagnostics',
2873 files: newDiagnostics,
2874 isNew: true,
2875 },
2876 ]
2877}
2878
2879/**
2880 * Get LSP diagnostic attachments from passive LSP servers.

Callers 1

getAttachmentsFunction · 0.85

Calls 2

toolMatchesNameFunction · 0.85
getNewDiagnosticsMethod · 0.80

Tested by

no test coverage detected