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

[9.x] Defineable editor href in dd #44378

Closed

Conversation

sirmathays
Copy link

@sirmathays sirmathays commented Sep 29, 2022

This PR enhances the awesome new feature, clickable dd output (#44211).

The structure of the href can be different in various editors. This allows you to define it to fit your needs. For example the issue for me was that since I develop sometimes on Windows' WSL2, I had to be able to customize the href quite significantly.

If config key app.editor_href is not defined, the default value is open?file={file}&line={line}.

How it works:

// config/app.php

return [
    // ....
    'editor' => 'vscode',
    'editor_href' => 'vscode-remote/wsl+Ubuntu-20.04{file}:{line}'
    // ...
];

Now the href will be for example vscode://vscode-remote/wsl+Ubuntu-20.04/home/matti/code/project/routes/web.php:17.

@nunomaduro
Copy link
Member

We've discussed internally, and what do you think about this format?

// Users could use just...
'editor' => 'vscode',
// In this one, we would use internally the format vscode://open?file={file}&line={line}...

// If users do...
'editor' => 'vscode://vscode-remote/wsl+Ubuntu-20.04{file}:{line}',
// We detect that the given href contains ://, so we use the full format internally...

// Finally, if users do...
'editor' => [
    'href' => 'vscode', // same rules as above...
    'base_path' => '/Users/username/Desktop/example-app',
],
// We use the same rules as above for the `href`, and yet we use the `base_path` for the base path and address the issue https://github.com/laravel/framework/pull/44360.

@nunomaduro
Copy link
Member

Going to close this pull request, and going to address it working on format I've explained on the last comment.

@nunomaduro nunomaduro closed this Sep 29, 2022
@sirmathays
Copy link
Author

I like it a lot 😍

@nunomaduro
Copy link
Member

@sirmathays Do you mind of try to use the branch #44406 locally, and let me know if it works for you in both the terminal and browser please.

@sirmathays
Copy link
Author

Can do!

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