Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit f5d220b

Browse files
committed
WIP.
1 parent 9c6ff10 commit f5d220b

File tree

5 files changed

+14
-31
lines changed

5 files changed

+14
-31
lines changed
Binary file not shown.

lib/shared/src/codebase-context/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,24 +221,24 @@ export class CodebaseContext {
221221

222222
const contextMessages: ContextMessage[] = []
223223
for (const preciseContext of await this.graph.getContext()) {
224+
const fence = '```'
225+
const symbolName = `${preciseContext.symbol.scipName} (${preciseContext.symbol.scipDescriptorSuffix})`
226+
// TODO - check comparison value
227+
const repo =
228+
preciseContext.repositoryName !== this.getCodebase()
229+
? ` in repository ${preciseContext.repositoryName}`
230+
: ''
231+
const text = `The symbol ${symbolName} is defined in the file ${preciseContext.filepath}${repo} as:\n\n${fence}${preciseContext.definitionSnippet}${fence}`
232+
console.log({ text }) // DEBUGGING
233+
224234
contextMessages.push({
225235
speaker: 'human',
226236
file: {
227237
repoName: preciseContext.repositoryName,
228238
fileName: preciseContext.filepath,
229239
},
230240
preciseContext,
231-
text: `
232-
As my coding assistant, use this context to help me answer the question asked:
233-
Here is the precise snippet of code that is relevant to the current active file: ${preciseContext.definitionSnippet}
234-
## Instruction
235-
- Do not enclose your answer with tags.
236-
- Do not remove code that might be being used by the other part of the code that was not shared.
237-
- Your answers and suggestions should based on the provided context only.
238-
- Make references to other part of the shared code.
239-
- Do not suggest code that are not related to any of the shared context.
240-
- Do not suggest anything that would break the working code.
241-
`,
241+
text,
242242
})
243243
contextMessages.push({ speaker: 'assistant', text: 'okay' })
244244
}

lib/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@mdi/js": "^7.2.96",
32-
"@sourcegraph/cody-shared": "https://github.com/sourcegraph/cody/releases/download/codyintel5/sourcegraph-cody-shared-0.0.0-codyintel.experimental.10.tgz",
32+
"@sourcegraph/cody-shared": "workspace:*",
3333
"classnames": "^2.3.2"
3434
}
3535
}
-59.8 KB
Binary file not shown.

pnpm-lock.yaml

Lines changed: 2 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)