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

npm.scriptExplorerExclude from .vscode/settings.json do not work #164557

Closed
Tracked by #212907
Sovgut opened this issue Oct 25, 2022 · 6 comments
Closed
Tracked by #212907

npm.scriptExplorerExclude from .vscode/settings.json do not work #164557

Sovgut opened this issue Oct 25, 2022 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmation-pending help wanted Issues identified as good community contribution opportunities tasks Task system issues
Milestone

Comments

@Sovgut
Copy link

Sovgut commented Oct 25, 2022

Type: Bug

When added any of script name, this config excluded all scripts instead of string items in config.

for example we have "start", "dev" and "build" in scripts, after adding "start" and "build" in this config, explorer view exclude all scripts and showing "No scripts found."

VS Code version: Code 1.72.2 (d045a5e, 2022-10-12T22:15:18.074Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No

System Info
Item Value
CPUs AMD Ryzen 9 5950X 16-Core Processor (32 x 3400)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.92GB (21.31GB free)
Process Argv --crash-reporter-id 1ce0b300-83b3-4db2-8041-5a6a9c0e7b7e
Screen Reader no
VM 0%
Extensions (15)
Extension Author (truncated) Version
vscode-openapi 42C 4.14.1
swagger-snippets adi 0.0.1
gitignore cod 0.9.0
vscode-eslint dba 2.2.6
EditorConfig Edi 0.16.4
prettier-vscode esb 9.9.0
dotenv mik 1.0.1
JetBrainsIcons Mos 1.0.4
vscode-docker ms- 1.22.2
material-icon-theme PKi 4.21.0
prisma Pri 4.5.0
vscode-rapidapi-client Rap 1.6.0
vscode-yaml red 1.10.1
intellicode-api-usage-examples Vis 0.2.6
vscodeintellicode Vis 1.2.29

(4 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyonecf:30548226
pyindex848cf:30577861
nodejswelcome1cf:30587006
fc301958:30595537

@meganrogge
Copy link
Contributor

can you pls provide me w your tasks.json file?

@meganrogge meganrogge added info-needed Issue requires more information from poster tasks Task system issues labels Oct 25, 2022
@Sovgut
Copy link
Author

Sovgut commented Oct 25, 2022

@meganrogge this issue is not related to tasks, this is related to npm scripts

I do not have .vscode/tasks.json at all.
If I understand correctly, npm.scriptExplorerExclude should remove unnecessary scripts from npm scripts view.

My current view:
image

Expected view:
image

View with script exclude config:
image

Used config in .vscode/settings.json:

{
  "npm.scriptExplorerExclude": [
    "format",
    "build",
    "prepare",
    "start",
    "start:drfqdev",
    "start:production",
    "mongod"
  ]
}

@Sovgut
Copy link
Author

Sovgut commented Oct 25, 2022

Added tasks and nothing changed.

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "npm",
      "script": "start:development",
      "group": "none",
      "label": "npm: start:development"
    },
    {
      "type": "npm",
      "script": "start:watch",
      "group": "none",
      "label": "npm: start:watch"
    }
  ]
}

@Sovgut
Copy link
Author

Sovgut commented Oct 25, 2022

I have found a source of problem.

When i've add an "start" to ignore, all scripts where "start" word is founded are ignored ("start:development", "start:production", etc.)

Without "start" ignoring:
image

With "start" ignoring:
image

Config:

{
  "npm.scriptExplorerExclude": ["format", "build", "prepare", "start", "mongod"]
}

@meganrogge meganrogge added confirmation-pending and removed info-needed Issue requires more information from poster labels Oct 25, 2022
@meganrogge meganrogge added this to the Backlog milestone Oct 25, 2022
@meganrogge meganrogge added help wanted Issues identified as good community contribution opportunities bug Issue identified by VS Code Team member as probable bug labels Oct 25, 2022
@babakks
Copy link
Contributor

babakks commented Oct 27, 2022

I'll submit a PR.

@meganrogge I can't reproduce it. If there's anything I'm missing, please let me know.

@Sovgut Currently, after rereading the thread more carefully, I can't see any unwanted behavior. Note that the npm.scriptExplorerExclude parameter accepts regex (not exact values). That's why when you add start to it, it will match any script with start anywhere in its name.

If you want to exclude the (exact) start and keep other start:* scripts, put start: to your configuration. I mean:

{
  "npm.scriptExplorerExclude": ["format", "build", "prepare", "start:", "mongod"]
}

@Sovgut
Copy link
Author

Sovgut commented Oct 27, 2022

@babakks Thanks.

I have made changes in configuration, and its works as should.

{
  "npm.scriptExplorerExclude": [
    "format",
    "build",
    "prepare",
    "start$",
    "mongod",
    ":drfqdev",
    ":production"
  ]
}

image

@Sovgut Sovgut closed this as completed Oct 27, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2022
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 confirmation-pending help wanted Issues identified as good community contribution opportunities tasks Task system issues
Projects
None yet
Development

No branches or pull requests

5 participants