Skip to content
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

change: replace vscode links with command #1919

Merged
merged 3 commits into from
Nov 28, 2023
Merged

Conversation

abeatrix
Copy link
Contributor

CLOSE: #1819

This PR replace the vscode links with custom protocol for the file links in chat view.

  • Replace the vscode file links with a custom "cody.chat.open.file" command protocol when displaying file names in chat. This allows handling file opening in a more customizable way without the error message described in the issue.

Test plan

Run the /explain command, and then click on the link after the @ sign:

Screen.Recording.2023-11-27.at.9.00.04.PM.mov

Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I've one small suggested change on the tab group behaviour.

const filteredFsPath = range ? fsPath.slice(0, rangeIndex) : fsPath
const uri = vscode.Uri.file(filteredFsPath)
const doc = await vscode.workspace.openTextDocument(uri)
const viewColumn = vscode.ViewColumn.Beside - 2 > 1 ? vscode.ViewColumn.Beside - 2 : vscode.ViewColumn.Beside
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand this line… but based on the video I think we should just let it open in a tab in the active group (which is what it did before by default, and same as what the file explorer does by default).

File explorer lets you command-click to open a file in a new tab group, how about we support that instead? (not required for this PR though)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've updated to open it in the current active editor instead:

Screen.Recording.2023-11-27.at.9.48.48.PM.mov

File explorer lets you command-click to open a file in a new tab group, how about we support that instead? (not required for this PR though)

I can't reproduce this behavior using the built-in vscode.open command, so we can file a feature request for this to work on after GA if that sounds good to you?

@abeatrix abeatrix merged commit e353bbc into main Nov 28, 2023
14 checks passed
@abeatrix abeatrix deleted the bee/open-file-comman branch November 28, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: external file warning when clicking files included via @ in new chat UI
2 participants