https://github.com/zigtools/scip-zig
SCIP indexer for Zig!
https://github.com/zigtools/scip-zig
Last synced: 10 months ago
JSON representation
SCIP indexer for Zig!
- Host: GitHub
- URL: https://github.com/zigtools/scip-zig
- Owner: zigtools
- License: mit
- Created: 2022-09-13T20:07:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T07:03:10.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T16:20:14.156Z (over 1 year ago)
- Language: Zig
- Size: 144 KB
- Stars: 24
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scip-zig
[SCIP](https://github.com/sourcegraph/scip) indexer for [Zig](https://ziglang.org). Experimental.
## Supported features
Our benchmark for `scip-zig` is its ability to index `std`; unfortunately importing external packages via `addPackage` isn't supported *yet*.
- [x] Globals
- [ ] Properly creating multiple indices for different packages
- [x] Imports
- [x] Namespaced declarations (structs, enums, unions)
- [x] Functions
- [ ] Arguments
- [x] Return values
- [x] Bodies
- [x] Locals
- [x] With explicit typing
- [ ] With inferred typing
- [ ] Easy integration into `build.zig` / CI
- [ ] `usingnamespace`
- [ ] `comptime`
## Installing
To install `scip-zig`, simply `git clone` this repository and run `zig build`; you'll find the indexer in `zig-out/bin`!
## Usage
```bash
# To index std; currently uses about a 400mbs of memory
# Windows: should finish in under 10 seconds in release-fast, under a minute in debug
# WSL: should finish in under 3 seconds in release-fast
scip-zig --root-path /path/to/zig --pkg std /path/to/zig/lib/std/std.zig --root-pkg std
src code-intel upload -github-token=$(cat tok) -file=index.scip
```
For example, let's index this very repo:
```bash
zig-out/bin/scip-zig --root-path $(pwd) --pkg scip-zig $(pwd)/src/main.zig --root-pkg scip-zig
scip convert --from index.scip
src code-intel upload -github-token=$(cat tok) -file=index.scip
```