कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

swiftfindrefs

michaelversus द्वारा

iOS & macOS Development
1.6kclawskills.sh द्वारा बताए गए डाउनलोड
1स्टार
0व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Use swiftfindrefs (IndexStoreDB) to list every Swift source.

विवरण

यह स्किल क्या करती है

swiftfindrefs queries Xcode's IndexStore (DerivedData) to return every Swift source file that references a given symbol. It covers classes, structs, enums, protocols, functions, and variables across modules. Output is one absolute file path per line, deduplicated and safe to pipe.

grep and IDE search operate on text and miss references that the compiler resolved through type inference or module re-exports, while IndexStoreDB reflects what was actually compiled.

इसे कब इस्तेमाल करें

  • Finding all callers of a function before renaming it
  • Auditing files affected by moving a type to a new module
  • Adding missing imports only to files that reference a relocated symbol
  • Confirming a symbol is unused before deleting it
  • Scoping a cross-module refactor to exactly the files that matter

उदाहरण वर्कफ़्लो

इनपुट

User asks: find all Swift files referencing UserSession before renaming it

एजेंट
  1. 1

    Run swiftfindrefs --projectName MyApp --symbolName UserSession --symbolType class

  2. 2

    Collect the list of absolute file paths from stdout

  3. 3

    Open only those files to review call sites

  4. 4

    Rename UserSession in each returned file

  5. 5

    Verify no other files were changed

आउटपुट

A deduplicated list of absolute paths to every .swift file referencing UserSession, ready for targeted edits

आवश्यकताएँ

  • Xcode installed on macOS (project must be built at least once to populate DerivedData)
  • swiftfindrefs CLI installed via Homebrew: brew tap michaelversus/SwiftFindRefs https://github.com/michaelversus/SwiftFindRefs.git && brew install swiftfindrefs

इंस्टॉलेशन

clawhub install michaelversus/swiftfindrefs

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक