Important
There is a Next.js/React rewrite in progress, in the rewrite
branch.
You can access the current version of this rewrite at codesense.kothavade.com
A hoogle.haskell.org inspired code search engine that works with any typed language (only support C and Rust for now, more to come).
Live demo available at codesense-v1.kothavade.com!
Upload a .c
, .h
or .rs
file, paste a link to raw source code (eg. a raw.githubusercontent.com link), or select one of the examples provided.
Then, search for a function by name, or by parameter types and return type--for example, if you want to find this function from raylib.h
:
Color ColorAlpha(Color color, float alpha);
you can search for it by name: colora
, or by type: Color, float -> Color
.
Searching is flexible--both Color, float ->
and -> Color
are valid searches, for example.
$ nix develop # or `direnv allow`, if you prefer
$ pnpm dev
First, install the dependencies:
- Emscripten (or Docker)
- Tree-sitter CLI
- NodeJS 18+
- PNPM
Then, set the node and WASM dependencies:
$ ./build-wasm.sh # Builds language-specific WASM binaries
$ pnpm i
$ pnpm wasm # Links main tree-sitter WASM binary from node_modules
$ pnpm dev
- This application uses Tree-sitter, an incremental parsing library with support for almost every language1, compiled to WebAssembly to parse source code in-browser
- Functions, parameters, and return types are found using custom written Tree-sitter queries2, found in
/queries
- Functions, parameters, and return types are found using custom written Tree-sitter queries2, found in
- The UI is build with SolidJS3 with Vite as the build tool/bundler and PicoCSS for styling