sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.53k stars 261 forks source link

Agent: add vscode-shim support for open commands #5118

Closed abeatrix closed 1 month ago

abeatrix commented 1 month ago

close https://linear.app/sourcegraph/issue/CODY-2799/implement-vscodeopen-command-in-shims-to-get-local-context-link

This change adds support for the vscode.open command in the vscode-shim. The vscode.open command is used to open a URI in the default application. The implementation first tries to open the URI as a text document, and if that fails, it falls back to using the open library to open the URI in the default application.

Additionally, the env.openExternal function has been implemented to open a URI in the default external application.

These changes ensure that the vscode-shim provides a more complete implementation of the VSCode API, allowing for better integration with VSCode-based applications.

Test plan

Can open context link from chat in JetBrains

vscodeopen

Changelog