davidnussio / vscode-jq-playground

Visual Code Studio jq playground
https://marketplace.visualstudio.com/items?itemName=davidnussio.vscode-jq-playground
MIT License
46 stars 8 forks source link

add command for input variables #66

Closed JeffreyMercado closed 3 years ago

JeffreyMercado commented 3 years ago

Adds a command to invoke JQ for use as an input variable in vscode tasks.

resolves #64

ghost commented 3 years ago

DeepCode's analysis on #fb8a16 found:

Description Example fixes
Type declaration of 'any' loses type-safety. Consider replacing it with a more precise type. Occurrences: :wrench: Example fixes
Unnecessary 'await'. Occurrences: :wrench: Example fixes
Identifier 'args' is never reassigned; use 'const' instead of 'let'. Occurrences: :wrench: Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

davidnussio commented 3 years ago

Thanks, good job. I checked out the branch and tested quickly.

Could you share some use cases?

JeffreyMercado commented 3 years ago

Thanks, good job. I checked out the branch and tested quickly.

Could you share some use cases?

Sure. I'm trying to set up some launch configurations for a asp.net project I'm working on. One of the limitations is that vscode is unware of the launch profiles and doesn't open the startup url. So we could create a launch task that would allow you to select and launch your startup project.

{
  "inputs": [
    {
      "id": "startup-project",
      "type": "pickString",
      "description": "Startup Project",
      "default": "SolutionClient",
      "options": ["SolutionClient", "SolutionAdmin"]
    },
    {
      "id": "startup-launch-url",
      "type": "command",
      "command": "extension.executeJqInputCommand",
      "args": {
        "input": "${workspaceFolder}/${config:solution-dir}/${input:startup-project}/Properties/launchSettings.json",
        "filter": ".profiles[$startupProject].launchUrl",
        "arg": {
          "startupProject": "${input:startup-project}"
        },
        "raw-output": true
      }
    }
  ]
}