microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.33k stars 28.59k forks source link

Relative path patterns not supported by search api #121087

Closed Zardddddd60 closed 1 year ago

Zardddddd60 commented 3 years ago

Steps to Reproduce: I try to debug a package symlinked to an application, with breakpoints set in typescript, but failed.

Firstly, without symlinked package, just the application, it works. image

image

Then, with symlinked package, it dosen't work, even the package is not actually imported. Setting the path of testpackage in outFiles makes error. image image

I've made a reproductive example. Is there something I missed?

1.git clone git@github.com:Zardddddd60/testpackage.git, git clone git@github.com:Zardddddd60/testapp.git

  1. symlink testpackage to testapp, and press debug in testapp

Does this issue occur when all extensions are disabled?: Yes/No Yes

vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Zardddddd60 commented 3 years ago

I think the key is how to set the outFiles. It works if I debug the javascript code of symlinked package with program pointing to typescript file. Is there is way to debug typescript code of symlinked package?

image

connor4312 commented 3 years ago

/jsDebugLogs

Zardddddd60 commented 3 years ago

/jsDebugLogs

Setting absolute path(/Users/liudong/ldd/test__/testpackage/**/*.js) of symlinked package in outFiles: vscode-debugadapter-92cc30e1.json.gz

Setting relative path(${workspaceFolder}/node_modules/testpackage/**/*.js) of symlinked package: vscode-debugadapter-03d7fa4d.json.gz

connor4312 commented 3 years ago

Thanks for the logs and example repo! I think I can reproduce. It should only affect breakpoints that are passed very early on in the program, since the process that looks for sourcemaps ahead of time isn't finding results.

@roblourens although the path seems correct, it seems like setting this as a RelativePattern doesn't work:

As Zard reported, f I remove the extra outFiles pattern (so it's just **/*.js) then it works. Is this comma-delimiting the correct way to deal with these? Or should I just run separate searches for each include path? That would be easy to do.

Edit: it seems that passing in a relative pattern like ../testpacakge/**/*.js individually also does not work, so it seems like include just doesn't work with those. However, it does in the UI

It would be nice to fix that 🙂

roblourens commented 3 years ago

It should be like {a, b} if you have multiple patterns. But yeah, the search view has bonus features that don't show up other places. I think this would go all the way to our glob library. Did it come in from the user's config or your code?

connor4312 commented 3 years ago

Ah, cool, thanks. That made it not break, but it looks like relative patterns still aren't applying correctly.

andreamah commented 1 year ago

Ah, cool, thanks. That made it not break, but it looks like relative patterns still aren't applying correctly.

see https://github.com/microsoft/vscode/issues/130992#issuecomment-1355186414

connor4312 commented 1 year ago

This actually duplicates https://github.com/microsoft/vscode/issues/168635, and should be fixed with https://github.com/microsoft/vscode-js-debug/pull/1486 as well