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

Function getOpenedFileFromIDE

src/utils/attachments.ts:1864–1892  ·  view source on GitHub ↗
(
  ideSelection: IDESelection | null,
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

1862}
1863
1864async function getOpenedFileFromIDE(
1865 ideSelection: IDESelection | null,
1866 toolUseContext: ToolUseContext,
1867): Promise<Attachment[]> {
1868 if (!ideSelection?.filePath || ideSelection.text) {
1869 return []
1870 }
1871
1872 const appState = toolUseContext.getAppState()
1873 if (isFileReadDenied(ideSelection.filePath, appState.toolPermissionContext)) {
1874 return []
1875 }
1876
1877 // Get nested memory files
1878 const nestedMemoryAttachments = await getNestedMemoryAttachmentsForFile(
1879 ideSelection.filePath,
1880 toolUseContext,
1881 appState,
1882 )
1883
1884 // Return nested memory attachments followed by the opened file attachment
1885 return [
1886 ...nestedMemoryAttachments,
1887 {
1888 type: 'opened_file_in_ide',
1889 filename: ideSelection.filePath,
1890 },
1891 ]
1892}
1893
1894async function processAtMentionedFiles(
1895 input: string,

Callers 1

getAttachmentsFunction · 0.85

Calls 2

isFileReadDeniedFunction · 0.85

Tested by

no test coverage detected