Merge pull request #3412 from continuedev/nate/quick-edit-6649
recursively render .prompt files
This commit is contained in:
commit
645468623c
2 changed files with 26 additions and 2 deletions
|
|
@ -26,8 +26,21 @@ async function resolveAttachment(
|
|||
|
||||
// Files
|
||||
if (await extras.ide.fileExists(name)) {
|
||||
let subItems: ContextItem[] = [];
|
||||
if (name.endsWith(".prompt")) {
|
||||
// Recurse
|
||||
const [items, _] = await renderPromptFileV2(
|
||||
await extras.ide.readFile(name),
|
||||
extras,
|
||||
);
|
||||
subItems.push(...items);
|
||||
}
|
||||
|
||||
const content = `\`\`\`${name}\n${await extras.ide.readFile(name)}\n\`\`\``;
|
||||
return [{ name: getBasename(name), content, description: name }];
|
||||
return [
|
||||
...subItems,
|
||||
{ name: getBasename(name), content, description: name },
|
||||
];
|
||||
}
|
||||
|
||||
// URLs
|
||||
|
|
|
|||
|
|
@ -47,12 +47,23 @@ If you don't need any of these parameters, you can leave out the preamble and do
|
|||
|
||||
### Context
|
||||
|
||||
Many [context provider](../context-providers.md) can be referenced by typing "@" followed by the name of the context provider.
|
||||
Many [context provider](../context-providers.md) can be referenced by typing "@" followed by the name of the context provider. The currently supported list is:
|
||||
|
||||
- `@terminal` - The contents of the terminal
|
||||
- `@currentFile` - The currently active file
|
||||
- `@open` - All open files
|
||||
- `@os` - Information about the operating system
|
||||
- `@problems` - Problems reported by the language server in the active file
|
||||
- `@repo-map` - A map of files in the repository
|
||||
- `@tree` - A tree view of the repository structure
|
||||
|
||||
Or you can directly type URLs and file paths:
|
||||
|
||||
- `@https://github.com/continuedev/continue` - The contents of a URL
|
||||
- `@src/index.ts` - The contents of a file (VS Code only)
|
||||
|
||||
All references will be attached as context items, rather than injected directly inline.
|
||||
|
||||
## Feedback
|
||||
|
||||
If you have ideas about how to improve the `.prompt` file format, please reach out on [Discord](https://discord.gg/NWtdYexhMs).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue