microsoft / vscode

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

`skipFiles` does not support paths containing an at-sign (@) #203408

Closed Xunnamius closed 7 months ago

Xunnamius commented 7 months ago

Type: Bug

It seems the skipFiles property in .vscode/launch.json does not support paths containing the at-sign (@).

I'm trying to debug a babel-related issue and want to step through only @babel/* packages in node_modules. For example, say I wanted to peer into /repos/babel-plugin-tester/node_modules/@babel/core/lib/index.js.

The following does not work:

{
"skipFiles": [
    "<node_internals>/**",
    "**/node_modules/**",
    "!**/node_modules/@babel/**/*.js"
  ]
}

While this does:

{
"skipFiles": [
    "<node_internals>/**",
    "**/node_modules/**",
    "!**/node_modules/*babel/**/*.js"
  ]
}

Steps to reproduce:

  1. Install a scoped package (e.g. @scope/pkg-name) from npm
  2. Configure skipFiles to skip all files under node_modules in launch.json (works)
  3. Attempt to further configure skipFiles with a negative glob pattern targetting said scoped package (does not work)

VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:19.222Z) OS version: Linux x64 5.15.0-86-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen Threadripper 3970X 32-Core Processor (64 x 4150)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|4, 4, 5| |Memory (System)|125.65GB (40.53GB free)| |Process Argv|--crash-reporter-id ac330e88-bd69-4507-b330-7c870afb9c07| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|plasma| |XDG_CURRENT_DESKTOP|KDE| |XDG_SESSION_DESKTOP|KDE| |XDG_SESSION_TYPE|x11|
Extensions (74) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-m3u|af4|1.0.0 Bookmarks|ale|13.4.2 project-manager|ale|12.7.0 vscode-styled-jsx-languageserver|And|1.0.1 chronicler|arc|0.1.16 quitcontrol-vscode|art|4.0.0 github-markdown-preview|bie|0.3.0 markdown-checkbox|bie|0.4.0 markdown-emoji|bie|0.3.0 markdown-footnotes|bie|0.1.1 markdown-mermaid|bie|1.21.0 markdown-preview-github-styles|bie|2.0.3 markdown-yaml-preamble|bie|0.1.0 vscode-styled-jsx|bla|2.1.1 vscode-intelephense-client|bme|1.10.2 vscode-toggle-quotes|Bri|0.3.6 npm-intellisense|chr|1.4.5 systemd-unit-file|coo|1.0.6 vscode-eslint|dba|2.4.4 api-blueprint-viewer|dev|0.9.4 githistory|don|0.6.20 gitlens|eam|14.7.0 prettier-vscode|esb|10.1.0 vscode-firefox-debug|fir|2.9.10 vscode-github-actions|git|0.26.2 vscode-pull-request-github|Git|0.78.1 gc-excelviewer|Gra|4.2.58 vscode-wordcount-cjk|hol|1.3.1 prettier-sql-vscode|inf|1.6.0 tablegenerator|Jay|1.0.4 vscode-position|jtr|1.1.2 rainbow-csv|mec|3.11.0 dotenv|mik|1.0.1 vscode-docker|ms-|1.28.0 isort|ms-|2023.10.1 python|ms-|2023.22.1 vscode-pylance|ms-|2023.12.1 remote-containers|ms-|0.327.0 remote-ssh|ms-|0.107.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.9 cpptools|ms-|1.18.5 cpptools-extension-pack|ms-|1.3.0 remote-explorer|ms-|0.4.1 sublime-keybindings|ms-|4.1.10 vscode-jest|Ort|6.1.1 markdown-github-dark|oza|0.1.0 vscode-auto-scroll|pej|1.2.0 vscode-versionlens|pfl|1.9.2 vscode-template-literal-editor|pli|0.10.0 polacode|pnp|0.3.4 vscode-sort-json|ric|1.20.0 vscode-paste-and-indent|Rub|0.0.8 text-marker|ryu|1.11.0 trailing-spaces|sha|0.4.1 indenticator|Sir|0.7.0 vscode-smoothtype|spi|1.2.0 rewrap|stk|1.16.3 code-spell-checker|str|3.0.1 sass-indented|syl|1.8.28 pdf|tom|1.2.2 transpose|v4r|0.0.6 vscode-apielements|vnc|0.6.7 vscode-icons|vsc|12.7.0 vscode-wakatime|Wak|24.4.0 vscode-import-cost|wix|3.3.0 change-case|wma|1.0.0 php-debug|xde|1.34.0 php-pack|xde|1.0.3 markdown-pdf|yza|1.5.0 markdown-all-in-one|yzh|3.6.2 html-css-class-completion|Zig|1.20.0 php-intellisense|zob|1.3.3 (2 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 vscaat:30438848 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30933248 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementsc:30887149 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 dsvsc019acf:30933242 ```
andreamah commented 6 months ago

@connor4312 is there a simple way to verify this? ie: some example code that would step through a scoped package

connor4312 commented 6 months ago

The steps given in the issue should be good:

  1. Install a scoped package (e.g. @scope/pkg-name) from npm. Or just make a module in a folder foo/@hello/world.js. Random package that has runnable demos in its readme.
  2. Configure skipFiles to skip all files under the folder in launch.json with skipFiles: ["<node_internals>/**", "**/node_modules/**"] -- now stepping into a method or function from that module should step through/over said method.
  3. Attempt to further configure skipFiles with a negative glob pattern targeting said scoped package with skipFiles: ["<node_internals>/**", "**/node_modules/**", "!**/node_modules/@my/module/**"], should no longer step through the method
andreamah commented 6 months ago

Thanks, knowing about the package helped!