Skip to content

Commit

Permalink
return a dummy mention in the hello-world provider (sourcegraph#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs authored and bevzzz committed Dec 12, 2024
1 parent 640aa8c commit 43ba882
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion provider/hello-world/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type {
AnnotationsResult,
ItemsParams,
ItemsResult,
MentionsParams,
MentionsResult,
MetaParams,
MetaResult,
Provider,
Expand All @@ -12,7 +14,7 @@ import type {

/**
* A demo [OpenCtx](https://openctx.org) provider that annotates every 10th line in every
* file with "✨ Hello, world!".
* file with "✨ Hello, world!" and returns a dummy mention.
*/
const helloWorld: Provider = {
meta(params: MetaParams, settings: ProviderSettings): MetaResult {
Expand All @@ -25,6 +27,16 @@ const helloWorld: Provider = {
}
},

mentions(params: MentionsParams, settings: ProviderSettings): MentionsResult {
return [
{
title: '✨ Hello, world!',
uri: 'https://openctx.org',
description: 'From OpenCtx',
},
]
},

items(params: ItemsParams, settings: ProviderSettings): ItemsResult {
return [
{
Expand Down

0 comments on commit 43ba882

Please sign in to comment.