Skip to content

Commit e35040f

Browse files
authored
Merge pull request microsoft#1202 from mjbvz/rising-toucan
Add chat output renderer proposed API sample
2 parents c89894c + 66e8b16 commit e35040f

File tree

10 files changed

+3893
-0
lines changed

10 files changed

+3893
-0
lines changed

.scripts/samples.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ export const samples: Sample[] = [
294294
{ description: 'authenticationprovider-sample', excludeFromReadme: true, path: 'authenticationprovider-sample', guide: null, apis: [], contributions: [] },
295295
{ description: 'configuration-sample', excludeFromReadme: true, path: 'configuration-sample', guide: null, apis: [], contributions: [] },
296296
{ description: 'chat-model-provider-sample', excludeFromReadme: true, path: 'chat-model-provider-sample', guide: null, apis: [], contributions: [] },
297+
{ description: 'chat-output-renderer-sample', excludeFromReadme: true, path: 'chat-output-renderer-sample', guide: null, apis: [], contributions: [] },
297298
{ description: 'contentprovider-sample', excludeFromReadme: true, path: 'contentprovider-sample', guide: null, apis: [], contributions: [] },
298299
{ description: 'diagnostic-related-information-sample', excludeFromReadme: true, path: 'diagnostic-related-information-sample', guide: null, apis: [], contributions: [] },
299300
{ description: 'document-paste', excludeFromReadme: true, path: 'document-paste', guide: null, apis: [], contributions: [] },
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
out
2+
node_modules
3+
.vscode-test/
4+
*.vsix
5+
vscode*.d.ts
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [{
8+
"name": "Run Extension",
9+
"type": "extensionHost",
10+
"request": "launch",
11+
"runtimeExecutable": "${execPath}",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "npm: watch"
19+
}
20+
]
21+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Chat Output Renderer sample
2+
3+
This VS Code extension sample demonstrates usage of the proposed chat output renderer API. This API allows extensions to
4+
contribute custom rendered widgets into VS Code's chat interface. Language models can invoke tools to create these widgets. The widgets are rendered using VS Code's webview API.
5+
6+
## Running the Sample
7+
8+
- Make sure you are using VS Code 1.103 or newer.
9+
- Run `npm install` in terminal to install dependencies
10+
- Run the `Run Extension` target in the Debug View. This will:
11+
- Start a task `npm: watch` to compile the code
12+
- Run the extension in a new VS Code window
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* ESLint configuration for the project.
3+
*
4+
* See https://eslint.style and https://typescript-eslint.io for additional linting options.
5+
*/
6+
// @ts-check
7+
import js from '@eslint/js';
8+
import tseslint from 'typescript-eslint';
9+
import stylistic from '@stylistic/eslint-plugin';
10+
11+
export default tseslint.config(
12+
{
13+
ignores: [
14+
'.vscode-test',
15+
'out',
16+
]
17+
},
18+
js.configs.recommended,
19+
...tseslint.configs.recommended,
20+
...tseslint.configs.stylistic,
21+
{
22+
plugins: {
23+
'@stylistic': stylistic
24+
},
25+
rules: {
26+
'curly': 'warn',
27+
'@stylistic/semi': ['warn', 'always'],
28+
'@typescript-eslint/no-empty-function': 'off',
29+
'@typescript-eslint/naming-convention': [
30+
'warn',
31+
{
32+
'selector': 'import',
33+
'format': ['camelCase', 'PascalCase']
34+
}
35+
],
36+
'@typescript-eslint/no-unused-vars': [
37+
'error',
38+
{
39+
'argsIgnorePattern': '^_'
40+
}
41+
]
42+
}
43+
}
44+
);

0 commit comments

Comments
 (0)