mirror of
https://github.com/openai/codex.git
synced 2026-04-30 19:32:04 +03:00
add: dynamic instructions (#927)
This commit is contained in:
@@ -325,14 +325,12 @@ function rewriteFileCitations(
|
||||
fileOpener: FileOpenerScheme | undefined,
|
||||
cwd: string = process.cwd(),
|
||||
): string {
|
||||
if (!fileOpener) {
|
||||
// Should we reformat the citations even if we cannot linkify them?
|
||||
return markdown;
|
||||
}
|
||||
|
||||
citationRegex.lastIndex = 0;
|
||||
return markdown.replace(citationRegex, (_match, file, start, _end) => {
|
||||
const absPath = path.resolve(cwd, file);
|
||||
if (!fileOpener) {
|
||||
return `[${file}](${absPath})`;
|
||||
}
|
||||
const uri = `${fileOpener}://file${absPath}:${start}`;
|
||||
const label = `${file}:${start}`;
|
||||
// In practice, sometimes multiple citations for the same file, but with a
|
||||
|
||||
Reference in New Issue
Block a user