Closed nielsvaneck closed 1 year ago
For the case that you linked I don't think it's expected that it would be linkified on Linux and macOS when the \
before the space is not present, what tools are outputting this? (it's a little more nuanced on Windows)
For the case that you linked I don't think it's expected that it would be linkified on Linux and macOS when the
\
before the space is not present, what tools are outputting this? (it's a little more nuanced on Windows)
just the error output generated by the python interpreter
Am i having the same issue, or is this different?
In the terminal, paths in the Python traceback are not linked/clickable if there is a space in the path, even though the path is quoted. For example:
File "/home/me/some space/myproject/mypapp/models.py", line 360, in foo
for obj in qs.distinct()
That seems to be the issue referenced by https://github.com/microsoft/vscode-python/issues/7491 (closed and conversation locked) which was moved to https://github.com/microsoft/vscode/issues/81190 (closed and conversation locked) which is marked as a duplicate of https://github.com/microsoft/vscode/issues/21125 which is supposedly fixed (closed and conversation locked).
Same problem for traceback inlined in the code editor while debugging (i'm not sure what this UI component is called, or where to find out).
@smcoll this is the same issue yes.
As of 1.49.0 we have stabilized the link provider API which would allow Python to add better support to Python-specific link formats like this one. The problem we face is the output could be literally everything, so our list of detection continues to grow and get slower and slower. While we could provide better support for spaces in names (that's what this issue is about), Python could improve the support by making this link do something with foo
if that's useful
File "/home/me/some space/myproject/mypapp/models.py", line 360, in foo
And maybe even give this line a link to do something useful:
for obj in qs.distinct()
FYI @luabud
@Tyriar is the line considered Python-specific because it's a format used in Python tracebacks? And are you saying that Python support could choose to link right to that line in the file, for example?
i opened https://github.com/microsoft/vscode-python/issues/7491 hoping that the original issue for the Python extension can be re-opened.
@smcoll I commented on https://github.com/microsoft/vscode-python/issues/13989
I don't think this is python specific –– I'm encountering the same bug in Node.js
Same here with Julia.
Version : 1.54.3 OS : Linux x64 5.8.0-48-generic snap
Same problem with Python in Windows 10 using Visual Studio Code (Version: 1.54.3) It does not allow to click hyperlinks in error messages if there is a space in the path.
This issue also exists with Swift on macOS:
Hey, this still happens to me, any updates?
I am also having this issue with Typescript and any other languages I have tried. It makes VSCode unusable for debugging in this sense, I have to manually find the line of code or reinstall Windows to make sure there are no spaces in my linked network and local paths. Please fix.
Same here, waiting for a fix :(
Same issue here with any error that get shown in Terminal. Example lint issue, with a path that contains a space ("IS Transfer"), and clicking the link should open up folder location, but attempts to open up "C:\IS" or "Transfer\Source...."
I am on it, will try my best.
@AgainPsychoX this is probably not the best candidate for a contribution as it's not yet known what an efficient solution would look like.
I was looking in the related code some time already and I have few ideas. Current solution does not seem to be efficient at all, in few places I can see Regex recompiled and executed even for the very same link.
Key things I would want to do are:
TerminalLink
class abstract, then move tooltip and activation callbacks from LinkManager
to TerminalLink
specializations (refactor to separate shared code). ITerminalInstance
in TerminalLink
s/providers (instead just Terminal
from xterm), as there are places the code need stuff from the general version (like widget manager; it will avoid listening to changes to update LinkManager
I think).shiraze
post above. Specialized provider could look not at certain line, but whole feed (stateful to detect path that are related to multiple following links of line/number). @AgainPsychoX thanks for looking into it, in general this sounds good 👍 I'd recommend small focused PRs to make them easier and less risky to review/merge
I can see Regex recompiled and executed even for the very same link.
I think we can just add @memoize
to TerminalValidatedLocalLinkProvider._localLinkRegex
for example to get caching happening.
Make TerminalLink class abstract, then move tooltip and activation callbacks from LinkManager to TerminalLink specializations (refactor to separate shared code).
I can't remember the reason for this, just make sure you don't introduce a circular dependency when doing this.
Better path detection, I already have interesting piece of more efficient Regexes to detect all current stuff plus spaces
I worry about trying to use regex for path with space detection as well as it's often not clear why a regex is slow and it seems like adding spaces to the regex will make it much more difficult to optimize.
Use more general ITerminalInstance in TerminalLinks/providers (instead just Terminal from xterm), as there are places the code need stuff from the general version (like widget manager; it will avoid listening to changes to update LinkManager I think).
This would add a circular dependency (TerminalInstance -> TerminalLinkManager -> ... -> TerminalLink -> TerminalInstance) which we should avoid as it will make unit testing more cumbersome.
eslint same here.
Any update on this?
For real, you'd think more people would complain since Windows' default account style has a space in the name... any of my documents have a space in the full path.
Same issue with paths in VSC's integrated terminal not being linked/clickable if there is a space in the path (in the file name in my case to be more specific). Would be very handy if it worked to directly jump to compilation errors.
Is there any update on this issue? And is there a workaround while we wait?
@bromelio no updates other than what is posted. A workaround is to select the link (double click + drag makes this easy), copy, then ctrl+p and paste
@Tyriar Thanks for the workaround, very attentive of you! I was hoping for something like replace space with \x20 in your upstream powershell code and it'll work, though 😉. But I guess that's simply not possible then? 😞
Anyway, please have this fixed. It's an annoying bug and I think you personally already found a solution (regex)? If your colleagues don't like regex barring any better idea then please simply tell them that users like bugs even less and push it through regardless. Less important things are constantly being implemented while we've already been patient for over two years here. Maybe we have to get a little more cheeky to be heard, too?
Hi everyone,
Same here when developing add-on for blender in VScode. The installation of Blender folder sadly have a space in name... "Blender Foundation"
Print something like this on error:
from . import error_handle
File "C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\myAddon\handle.py", line 176
.filename
^
I always want to click on that path :rage2: , it even has the line number hint included so it should be able to get there.
+1 for clickable path with space.
For now @Tyriar's workaround save the day (+ we can quickly add line number after path with :258
)
But still manual where it should be a one click jump to line.
Does any VScode user here have found a plug-in that parse the console and that could do that ?
Happy coding all
I put this together in https://github.com/microsoft/vscode/pull/169786, here are the detected formats when it gets merged:
From "<path>", line <line>
<path>
<path>(<line>,<col>) :<...>
foo<underlined_path>bar
I think that should cover the main cases called out in the issue, let me know if your case isn't covered by this.
Steps to Reproduce:
I have created a tiny repo that reproduces the bug: https://github.com/nielsvaneck/vscode_space_path_bug
Does this issue occur when all extensions are disabled?: Yes