WIP add sourcegraph

This commit is contained in:
2026-02-03 19:14:07 -10:00
parent 65d93d819b
commit dfff777d04
19 changed files with 1367 additions and 3 deletions
+10
View File
@@ -256,6 +256,16 @@ func prepareFileView(ctx *context.Context, entry *git.TreeEntry) {
default:
// unable to render anything, show the "view raw" or let frontend handle it
}
// Sourcegraph code intelligence configuration
if setting.Sourcegraph.Enabled {
ctx.Data["SourcegraphEnabled"] = true
ctx.Data["SourcegraphConfig"] = map[string]any{
"enabled": true,
"repoFullName": ctx.Repo.Repository.FullName(),
"commitID": ctx.Repo.CommitID,
}
}
}
func prepareFileViewEditorButtons(ctx *context.Context) bool {