-
Notifications
You must be signed in to change notification settings - Fork 279
feat: vscode extension #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
idosal
wants to merge
1
commit into
main
Choose a base branch
from
feat/vs-code
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,633
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| out | ||
| node_modules | ||
| .vscode-test/ | ||
| *.vsix | ||
| vscode*.d.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Run Extension", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "args": ["--extensionDevelopmentPath=${workspaceFolder}"], | ||
| "outFiles": ["${workspaceFolder}/out/**/*.js"], | ||
| "preLaunchTask": "${defaultBuildTask}" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "build", | ||
| "command": "npm", | ||
| "args": ["run", "compile"], | ||
| "type": "shell", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| }, | ||
| "presentation": { | ||
| "reveal": "silent" | ||
| }, | ||
| "problemMatcher": "$tsc" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Chat Output Renderer sample | ||
|
|
||
| This VS Code extension sample demonstrates usage of the proposed chat output renderer API. This API allows extensions to | ||
| 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. | ||
|
|
||
| ## Running the Sample | ||
|
|
||
| - Make sure you are using VS Code 1.103 or newer. | ||
| - Run `npm install` in terminal to install dependencies | ||
| - Run the `Run Extension` target in the Debug View. This will: | ||
| - Start a task `npm: watch` to compile the code | ||
| - Run the extension in a new VS Code window | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| const { build } = require('esbuild') | ||
|
|
||
| const baseConfig = { | ||
| bundle: true, | ||
| minify: process.env.NODE_ENV === 'production', | ||
| sourcemap: process.env.NODE_ENV !== 'production', | ||
| } | ||
|
|
||
| const extensionConfig = { | ||
| ...baseConfig, | ||
| platform: 'node', | ||
| mainFields: ['module', 'main'], | ||
| format: 'cjs', | ||
| entryPoints: ['./src/extension.ts'], | ||
| outfile: './out/extension.js', | ||
| external: ['vscode'], | ||
| } | ||
|
|
||
| const webviewConfig = { | ||
| ...baseConfig, | ||
| target: 'es2020', | ||
| format: 'esm', | ||
| entryPoints: ['./src/webview/index.tsx'], | ||
| outfile: './out/webview/index.js', | ||
| }; | ||
|
|
||
| (async () => { | ||
| try { | ||
| await build(extensionConfig) | ||
| await build(webviewConfig) | ||
| console.log('build complete') | ||
| } | ||
| catch (err) { | ||
| process.stderr.write(err.stderr) | ||
| process.exit(1) | ||
| } | ||
| })() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import stylistic from '@stylistic/eslint-plugin' | ||
| import tsEslint from 'typescript-eslint' | ||
| import js from '@eslint/js' | ||
|
|
||
| export default [ | ||
| js.configs.recommended, | ||
| ...tsEslint.configs.recommended, | ||
| stylistic.configs['recommended-flat'], | ||
| { | ||
| files: ['**/*.ts', '**/*.tsx'], | ||
| languageOptions: { | ||
| parser: tsEslint.parser, | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| project: './tsconfig.json', | ||
| }, | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@stylistic/indent': ['error', 'tab', { SwitchCase: 1 }], | ||
| '@stylistic/no-tabs': 'off', | ||
| '@stylistic/jsx-indent-props': ['error', 'tab'], | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| argsIgnorePattern: '^_', | ||
| varsIgnorePattern: '^_', | ||
| caughtErrorsIgnorePattern: '^_', | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, this needs to run from folder
extensions\vscode. If so, mention it in the readme.