This directory contains Zed editor configurations for developing kiji-proxy.
-
Install Delve (Go debugger):
go install github.com/go-delve/delve/cmd/dlv@latest
-
Ensure
dlvis in your PATH:which dlv
Access tasks via the command palette (cmd+shift+p) and type "task" or use cmd+shift+r.
- run kiji-proxy - Run the proxy server directly
- run with electron - Run with Electron UI (equivalent to
make electron-dev)
- debug kiji-proxy - Start the debugger server on port 2345
- After running this task, connect using a DAP client
- In Zed, you can attach to the process using the debugger panel
- Set breakpoints in the code before or after connecting
- build kiji-proxy - Compile the binary to
bin/kiji-proxy
- test proxy package - Run tests in
src/backend/proxy/ - test all backend - Run all backend tests
- vet proxy code - Run
go veton proxy code
- Run the task: debug kiji-proxy
- This starts a debug server on
localhost:2345 - Connect your debugger client to port 2345
- Set breakpoints and debug
- Run the task: run kiji-proxy
- Use log statements to debug
- Check the terminal output
The tasks automatically set these environment variables:
PROXY_PORT::8080OPENAI_BASE_URL:https://api.openai.com/v1DETECTOR_NAME:onnx_model_detectorDB_ENABLED:false(uses in-memory storage)LOG_REQUESTS:trueLOG_RESPONSES:trueLOG_PII_CHANGES:trueLOG_VERBOSE:false
tasks.json- Task definitions (run, debug, build, test)settings.json- Editor settings (Go formatting, LSP config).env- Additional environment variables (create if needed)
go install github.com/go-delve/delve/cmd/dlv@latest
export PATH="$PATH:$(go env GOPATH)/bin"Ensure tokenizers library is built:
make build-tokenizersChange PROXY_PORT in the task or kill existing process:
lsof -ti:8080 | xargs kill -9