mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Merge pull request #958 from microsoft/isidorn/delightful-viper
add cat_context variable
This commit is contained in:
@ -89,6 +89,28 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
};
|
||||
|
||||
vscode.chat.registerVariable('cat_context', 'Describes the state of mind and version of the cat', {
|
||||
resolve: (name, context, token) => {
|
||||
if (name == 'cat_context') {
|
||||
const mood = Math.random() > 0.5 ? 'happy' : 'grumpy';
|
||||
return [
|
||||
{
|
||||
level: vscode.ChatVariableLevel.Short,
|
||||
value: 'version 1.3 ' + mood
|
||||
},
|
||||
{
|
||||
level: vscode.ChatVariableLevel.Medium,
|
||||
value: 'I am a playful cat, version 1.3, and I am ' + mood
|
||||
},
|
||||
{
|
||||
level: vscode.ChatVariableLevel.Full,
|
||||
value: 'I am a playful cat, version 1.3, this version prefer to explain everything using mouse and tail metaphores. I am ' + mood
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
context.subscriptions.push(
|
||||
agent,
|
||||
// Register the command handler for the /meow followup
|
||||
|
||||
Reference in New Issue
Block a user