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

Open Project Files on click #1490

Merged
merged 2 commits into from
May 1, 2024
Merged

Open Project Files on click #1490

merged 2 commits into from
May 1, 2024

Conversation

dotNomad
Copy link
Collaborator

@dotNomad dotNomad commented May 1, 2024

This PR adds a new webview to host message for vscode.open allowing the Project Files view to open files on click.

Intent

Part of #1344

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

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

This looks good to me. I only had one comment regarding some overlap with what I've implemented (but not yet pushed a PR on). Let me know what you want to do.

export type VsCodeOpenMsg = AnyWebviewToHostMessage<
WebviewToHostMessageType.VSCODE_OPEN,
{
uri: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not surprising, this functionality overlaps with some that I needed to implement to open the current requirements file. Unfortunately, I do not have a complete path to the file, so I implemented my handler as a relative path, which is then turned into a full path uri.

You obviously have the absolute path, so you don't need it, but I was wondering if we want to modify this message with a boolean parameter for relative or not. I could certainly do this in my merging of your implementation into mine, but I wanted to mention it.

Or we could go the route of relative paths only and send that up, with the host turning it into a full path uri.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think having a raw vscode.open that has the same URI parameter and another message like relative.vscode.open that takes a relative file name in the content and knows to transform it could work.

That would give us both options.

Base automatically changed from dotnomad/project-files-content to main May 1, 2024 20:27
@dotNomad dotNomad merged commit 4c31e4f into main May 1, 2024
16 checks passed
@dotNomad dotNomad deleted the dotnomad/open-action branch May 1, 2024 20:27
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.

2 participants