MCPcopy Index your code
hub / github.com/codeaashu/claude-code / notifyVscodeFileUpdated

Function notifyVscodeFileUpdated

src/services/mcp/vscodeSdkMcp.ts:39–59  ·  view source on GitHub ↗
(
  filePath: string,
  oldContent: string | null,
  newContent: string | null,
)

Source from the content-addressed store, hash-verified

37 * notify VSCode when files are edited or written by Claude.
38 */
39export function notifyVscodeFileUpdated(
40 filePath: string,
41 oldContent: string | null,
42 newContent: string | null,
43): void {
44 if (process.env.USER_TYPE !== 'ant' || !vscodeMcpClient) {
45 return
46 }
47
48 void vscodeMcpClient.client
49 .notification({
50 method: 'file_updated',
51 params: { filePath, oldContent, newContent },
52 })
53 .catch((error: Error) => {
54 // Do not throw if the notification failed
55 logForDebugging(
56 `[VSCode] Failed to send file_updated notification: ${error.message}`,
57 )
58 })
59}
60
61/**
62 * Sets up the speicial internal VSCode MCP for bidirectional communication using notifications.

Callers 4

callFunction · 0.85
callFunction · 0.85
applySedEditFunction · 0.85

Calls 1

logForDebuggingFunction · 0.85

Tested by

no test coverage detected