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

ENH: vscode links in console only give relative paths #399

Open
NickCrews opened this issue Jul 19, 2023 · 5 comments
Open

ENH: vscode links in console only give relative paths #399

NickCrews opened this issue Jul 19, 2023 · 5 comments
Labels
blocked This issue is blocked enhancement New feature or request

Comments

@NickCrews
Copy link
Contributor

NickCrews commented Jul 19, 2023

Is your feature request related to a problem?

I love how the tasks in the console are links so I can click through to the original file. But, it seems like the included path is only relative, so if I have both "users/tasks.py" and "orders/tasks.py", then the link only points to "tasks.py", and vscode isn't sure which file to use, so it gives me a dialog. I would like to avoid this dialog.

image

Describe the solution you'd like

The included path should be absolute so there is no ambiguity. I assume this would fix the dialog issue, but I'm not sure.

API breaking implications

I don't think any?

Additional context

IDK about pycharm and the file:///, but I assume they should be able to handle absolute paths as well.

I'm not sure if this is important, but I am using vscode in a workspace setup, where I have multiple git repos all getting tracked in the same workspace. So in the above screenshot it looks like vscode is getting confused between the two repos, but I bet this isn't super relevant, I think the absolute path is still the best solution. But I wanted to include this detail just in case.

@NickCrews NickCrews added the enhancement New feature or request label Jul 19, 2023
@tobiasraabe
Copy link
Member

I believe that the file links pytask creates are always using absolute paths. Can you show me a screenshot of the url you clicked on? Then, I can trace it back more easily.

@NickCrews
Copy link
Contributor Author

OK, so the 🐍 <Module noatak/_tasks.py> link actually works and goes to the right file. It's the 📝 <Function _tasks.py::task_ascribe_donations> links that open up the dialog that I screenshotted above.

I'm not sure how to actually inspect the raw URLs in the terminal, before they are rendered as links. I tried cmd-clicking, copy-pasting, and looking around for a "show raw" option. Any tips?

image

@tobiasraabe
Copy link
Member

I could replicate your problem. You are trying to click on the links within vscode, right? pytask creates a link only in the task name, the part that is underlined. But, when you hold the ALT key (on Windows, is it CMD on Mac) and hover over the task name, even the greyed-out part becomes underlined.

The problem is that vscode overlays pytask's links with its own link/file detection. And, within your vscode workspace, _tasks.py is ambiguous.

We would need to read up on what vscode is doing and whether there is a way to make it respect terminal links over its own.

@tobiasraabe
Copy link
Member

Probably related to https://github.com/microsoft/vscode/issues/176812. Only normal http/https urls seem to work right now.

image

@tobiasraabe tobiasraabe added the blocked This issue is blocked label Oct 27, 2023
@tobiasraabe
Copy link
Member

The latest vscode update should provide a fix. They enabled a lot more protocols.

Unfortunately, I cannot verify it right now since WSL2 is not supported yet and I do not have another machine around. The issue is tracked here: https://github.com/microsoft/vscode/issues/211443.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants