dsh-plugin-verified-search
f0909172434
Verified current-source search workflow for DeepSeek Harness
PROJECT TOPICS
PROJECT README
A SCIP indexer for Swift. It converts a Swift repo's build
index into genuine scip.proto output — real protobuf Index/Document/Symbol/Occurrence
messages, consumable by any standard SCIP tool (the scip CLI, codeintel, Sourcegraph, editor
plugins) — by reading the same IndexStoreDB index
that powers Xcode's own "jump to definition" and SourceKit-LSP.
scip-swift builds your repo with indexing-while-building enabled:swift build --enable-index-storexcodebuild ... COMPILER_INDEX_STORE_ENABLE=YESIndexStoreDB's SymbolOccurrence query API.Occurrence/SymbolInformation — including symbol
relationships (overrides), role bits, and minimal signatures — and emits a .scip file.
See docs/system-architecture.md for the component-by-component breakdown.
macOS 14 (Sonoma) or later is required.
Homebrew:
brew install phuongddx/scip-swift/scip-swift
Or build from source (requires a Swift toolchain matching the pinned version in
.swift-version):
git clone https://github.com/jarvis-intelligence/scip-swift.git
cd scip-swift
swift build -c release
cp .build/release/scip-swift /usr/local/bin/
Prebuilt universal binaries (arm64 + x86_64) are attached to each GitHub release.
scip-swift /path/to/your/swift/repo
# writes /path/to/your/swift/repo/index.scip
The index subcommand is equivalent — useful for tools that always pass an explicit subcommand
name (index is also scip-swift's defaultSubcommand, so the bare form above dispatches to it):
scip-swift index /path/to/your/swift/repo --output /path/to/output.scip
Options:
| Flag | Meaning |
|---|---|
--output <path> |
Where to write the .scip file (default: <repo>/index.scip) |
--build-tool swiftpm\|xcodebuild |
Override auto-detection (Package.swift → swiftpm, .xcodeproj/.xcworkspace → xcodebuild) |
--configuration debug\|release |
Forwarded to the underlying build tool (default: debug) |
--scheme <name> |
Xcode scheme to build (only for xcodebuild; auto-detected if the project has exactly one scheme) |
--cache-dir <path> |
Directory for the incremental index cache (default: <repo>/.scip-cache). Passing this flag enables the persistent cache |
--index-only |
Skip the build step and read an existing IndexStore directly (from the cache directory) |
--version |
Print the converter version and the Swift toolchain version it was built against |
index-many indexes two or more repos independently, writing one .scip per repo or merging
them into a single index:
# one .scip per repo, written to --output-dir (default: current directory)
scip-swift index-many /path/to/repoA /path/to/repoB --output-dir out/
# merge into a single index (default: ./merged.scip)
scip-swift index-many /path/to/repoA /path/to/repoB --merge --merged-output combined.scip
index-many supports --configuration and --cache-dir as well.
Passing --cache-dir (or --index-only) switches the pipeline from a throwaway temp directory
to a persistent cache:
Scip_Document (keyed by SHA256 content hash),
so re-indexing after small edits only reprocesses what changed.scip-swift version,
indexstore-db revision, or build backend changes (recorded in manifest.json).--index-only reuses the already-built IndexStore under the cache directory (it does not
rebuild), so it fails with indexStoreNotFoundForIndexOnly if no prior indexed build exists
there.Indexing any repo that imports Apple-platform-only frameworks (UIKit, WatchKit, WidgetKit)
requires a macOS host with Xcode and the relevant SDKs — Apple does not ship the iOS SDK for Linux.
Pure Swift-package code without those imports can build (and be indexed) on Linux, but that's not
the common case for a real iOS app repo. If the underlying build command fails for this reason,
scip-swift surfaces it as a build failure rather than silently producing a partial index.
Scip_SymbolInformation.symbol embeds the compiler's raw USR
(Unified Symbol Resolution string) as an opaque, escaped identifier rather than a demangled
namespace/type/method descriptor chain. USRs are already a compiler-guaranteed, project-wide
unique and stable identifier, so cross-references resolve correctly — but the raw symbol string
isn't human-readable the way com/example/MyClass#myMethod(). is for some other SCIP indexers.scip.proto's SymbolRole enum has no call-specific bit; call
sites are marked with the same ReadAccess/WriteAccess roles as any other reference..swift-version); indexing with a
different toolchain version may be fine in practice but isn't a supported/tested configuration.swift build
swift test
Regenerating the vendored SCIP protobuf bindings (only needed if Protos/scip.proto is updated
from upstream sourcegraph/scip):
brew install protobuf swift-protobuf
Protos/generate.sh
Apache-2.0 — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。