NVIDIA / nsight-vscode-edition

A Visual Studio Code extension for building and debugging CUDA applications.
Other
72 stars 11 forks source link

Error in tasks.json #37

Closed Engineer2B closed 5 months ago

Engineer2B commented 1 year ago

Type: Bug

I get the error "Matches multiple schemas when only one must validate." in "tasks.json" when enabling the extension.

Extension version: 2023.2.32964508 VS Code version: Code 1.80.0 (660393deaaa6d1996740ff4880f1bad43768c814, 2023-07-04T15:06:02.407Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info |Item|Value| |---|---| |CPUs|13th Gen Intel(R) Core(TM) i5-13600KF (20 x 3494)| |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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.84GB (20.48GB free)| |Process Argv|--crash-reporter-id cd94dd0b-d51e-4e8d-bcc9-5cef1a15d829| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263:30776702 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 03d35959:30757346 pythonfmttext:30731395 pythoncmv:30756943 fixshowwlkth:30771522 hideindicator:30766889 pythongtdpath:30769146 i26e3531:30780429 pythonnosmt12:30779714 pythonidxpt:30784022 pythonnocebcf:30776496 ```
sanannavyaa commented 1 year ago

Hi, are you able to share your tasks.json? Thank you!

Engineer2B commented 1 year ago

This gives the warning/error:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "👁️ Run gulp",
            "type": "shell",
            "command": "gulp | Tee-Object -File \"$LOG_FOLDER/My-Project.log\" -Append",
            "group": {
                "kind": "none",
                "isDefault": true
            },
            "runOptions": {
                "runOn": "folderOpen"
            }
        }
    ]
}

It disappears when changing

            "command": "gulp | Tee-Object -File \"$LOG_FOLDER/My-Project.log\" -Append",
            "group": {
                "kind": "none",
                "isDefault": true
            },

to

            "command": "gulp | Tee-Object -File \"$LOG_FOLDER/My-Project.log\" -Append",
            "windows":{
                "command": "gulp | Tee-Object -File \"$LOG_FOLDER/MyProject.log\" -Append",
            },
            "group": {
                "kind": "none",
                "isDefault": true
            },
sanannavyaa commented 1 year ago

Hi, thanks for sharing this, a quick note about tasks - the support for customizing tasks is provided by Microsoft, we only provide support for tasks that are shipped with our extension (for instance, the various autostart tasks) so one thing to consider is that this might be a VS Code/ different extension bug. Secondly, I just tried the tasks.json you shared on a Linux computer - it worked just fine with no issues. I also tried it on a windows computer where I saw the issue you see. On windows,

  1. Initially, I reloaded the debugger window (Ctrl + shift + P -> Reload window) reload and that helped.
  2. In another independent instance of VS Code, I did not reload it, I just ran the task despite the warning of it matching multiple schemas and it worked just fine.

I am curious to know what is your motivation behind adding the "windows" argument? That also works, but just curious if that does/doesn't impact the way you want this task to function?

Engineer2B commented 5 months ago

Never saw the reply to this. The problem resides in the json schema in package.json for tasks of type "shell" (used to validate tasks), which clashes with the json schema that vscode uses for tasks of type "shell", i.e., the piece of code:

      "taskDefinitions": [
            {
                "type": "shell",
                "required": [
                    "type",
                    "command",
                    "label"
                ],
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "command": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string"
                    },
                    "host": {
                        "type": "string"
                    },
                    "port": {
                        "type": "string"
                    },
                    "executable": {
                        "type": "string"
                    },
                    "remoteExecutable": {
                        "type": "string"
                    },
                    "executableBinaryName": {
                        "type": "string"
                    }
                }
            }
        ],

Changing "type": "shell" to, e.g., "type": "nsight vs code edition shell" would fix the issue.