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

Unable to open file at a line number from the terminal if filename ends with a period #200257

Closed
sparxooo opened this issue Dec 7, 2023 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member terminal-links verified Verification succeeded

Comments

@sparxooo
Copy link
Contributor

sparxooo commented Dec 7, 2023

Type: Bug

When opening a file:line number link (ctrl-click) from the terminal that ends with a period, in the format "File.tsx:25", VSCode does not find any results as the period is included with the line number. Removing the period finds the result successfully.

Screenshot 2023-12-07 174701

If you remove the period, then the search functions successfully, as expected.

Screenshot 2023-12-07 174714

The trailing period should be ignored, as it is not part of the line number.

VS Code version: Code - Insiders 1.85.0-insider (af28b32, 2023-12-06T11:15:22.766Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 5 3600 6-Core Processor (12 x 3600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.93GB (16.27GB free)
Process Argv --crash-reporter-id e7ee9cdf-761c-4795-a9fd-a3471e3f552b
Screen Reader no
VM 36%
Item Value
Remote Dev Container: App
OS Linux x64 5.15.133.1-microsoft-standard-WSL2
CPUs AMD Ryzen 5 3600 6-Core Processor (12 x 3600)
Memory (System) 15.59GB (11.25GB free)
VM 0%
Extensions (13)
Extension Author (truncated) Version
es7-react-js-snippets dsz 4.4.3
codespaces Git 1.16.4
remotehub Git 0.62.0
remote-containers ms- 0.328.0
remote-wsl ms- 0.81.8
azure-repos ms- 0.38.0
remote-repositories ms- 0.40.0
vscode-eslint dba 2.4.2
prettier-vscode esb 10.1.0
copilot Git 1.140.0
copilot-chat Git 0.11.0
vscode-docker ms- 1.28.0
prisma Pri 5.7.0

(1 theme extensions excluded)

A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
py29gd2263:30784851
vscaat:30438846
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
2i9eh265:30646982
showlangstatbar:30737417
fixshowwlkth:30771523
showindicator:30805243
pythongtdpath:30726887
i26e3531:30792625
welcomedialog:30812478
pythonnosmt12:30779711
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
pythonmhint1:30901775
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30902439
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
aa_t_chat:30882232

@hediet hediet assigned Tyriar and unassigned hediet Dec 8, 2023
@joyceerhl joyceerhl added bug Issue identified by VS Code Team member as probable bug terminal-links labels Dec 14, 2023
@joyceerhl
Copy link
Contributor

I can't reproduce the described behavior:
image
Do you have a project that this consistently occurs in, e.g. if you are using custom tasks?

@joyceerhl joyceerhl added the info-needed Issue requires more information from poster label Dec 14, 2023
@sparxooo
Copy link
Contributor Author

I can't reproduce the described behavior: image Do you have a project that this consistently occurs in, e.g. if you are using custom tasks?

Hi joyceerhl,

The links are present, and highlighted correctly (with the underline), and can be clicked, but they don't seem to function properly.

  • Line numbers not trailed by a period all seem to function properly.
  • Single digit line numbers trailed by a period will open the correct file, however will not place the caret on the correct line.
  • Double+ digit line numbers trailed by a period will not open the file, showing the "No matching results" text.

I've tested this on a clean 1.85.1 install on my Windows machine and Github Codespaces (also 1.85.1), and it does appear to be misbehaving. There is a repro repo here: https://github.com/sparxooo/PoCvscodebug

Thanks :)

sparxooo

@joyceerhl
Copy link
Contributor

I do repro this in a codespace, thanks for the detailed steps!

image

@joyceerhl joyceerhl added confirmed Issue has been confirmed by VS Code Team member and removed info-needed Issue requires more information from poster labels Dec 15, 2023
@sparxooo
Copy link
Contributor Author

sparxooo commented Dec 15, 2023

Interestingly, I think I found why single digit lines still open the correct file, and that's because the replace regex
text = text.replace(/:[^\\/][^\d]+$/, ''); in terminalLinkOpeners.ts:111 strips off the line/column number if it is a single digit, and then has a trailing period, but not if it's double+ digits.

Screenshot 2023-12-15 033526 Screenshot 2023-12-15 033411 Screenshot 2023-12-15 033458 Screenshot 2023-12-15 033506

Not a fix, but might be useful info.

@Tyriar Tyriar added this to the December / January 2024 milestone Dec 15, 2023
Tyriar added a commit that referenced this issue Dec 15, 2023
Fix for #200257 plus existing trailing non-numerics regex fix
@Tyriar Tyriar closed this as completed Dec 15, 2023
yiliang114 pushed a commit to yiliang114/vscode that referenced this issue Jan 3, 2024
Fix for microsoft#200257 plus existing trailing non-numerics regex fix
@amunger amunger added the verified Verification succeeded label Jan 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2024
@aiday-mar aiday-mar added this to the December / January 2024 milestone Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member terminal-links verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants