sourcegraph / openctx

See contextual info about code from your dev tools, in your editor, code review, and anywhere else you read code.
https://openctx.org
Apache License 2.0
136 stars 14 forks source link

Improve example providers #148

Open toolmantim opened 3 months ago

toolmantim commented 3 months ago

Updates the Hello World provider with an example of how to do mentions, and adds a simple JSON API example too

Fixes https://linear.app/sourcegraph/issue/CODY-2438/update-the-examples-on-openctxorg-to-show-mentions

toolmantim commented 3 months ago

Ah, will update tests…

PriNova commented 2 months ago

I would love to see a working example for a provider implemented as a standalone vs code extension (or similar) communicating with Cody over http. I wrote a vs code extension where I implemented a http server over localhost:1234 as endpoint and used that in the Cody settings as OpenCTX provider. Then I implemented the server.on('request', ...) function and as response the custom implemented Provider from the @openctx/provider npm (similar to your example above). In Cody the handshake works, but Cody does not show this custom provider. Badly, all other providers disappear (except 'Repository' and 'Current File')

Thank you.