confluentinc / confluentinc/vscode

[Spike] Explore custom sidebar resource `Uri`s

Open
#1,777 1 comment 0 reactions 4 assignees Claimed by @shouples View on GitHub
Copilot
Dominant language
TypeScript
Stars
34
Forks
17
Avg merge
1d 22h
Merged PRs (30d)
8

Description

Copilot chat supports [different output types](https://code.visualstudio.com/api/extension-guides/chat#supported-chat-response-output-types), but the `reference` and `anchor` types specifically use `Uri`s:

Considering VS Code uses `Uri`s for files, symbols, etc, and we're already using some of our own Uri schemes for read-only documents (message viewer previews, schema definitions, and Flink statements), we may be able to come up with our own `confluent-` Uris with custom handling in https://github.com/confluentinc/vscode/blob/main/src/uriHandler.ts (mainly calling `.reveal()` for the resource's main view provider).

Half-functional example:
Image

```ts
for (const env of environments) {
const envUri = Uri.parse(`confluent-environment://${env.id}`);
stream.anchor(envUri.with({ path: `/${env.name}` }), "TEST TITLE HERE"); // title is ignored
stream.reference(envUri, new ThemeIcon("gear")); // icon is ignored
}
```
(We may need to wait for VS Code API updates since following https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0691ed151006d619a77d5ad8104d444906a99502/types/vscode/index.d.ts#L19723-L19767 doesn't seem to show custom icons and titles)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.