zoukankan      html  css  js  c++  java
  • vscode tasks.json以及launch.json配置详解(待整理)

    tasks.json

      taks.json文件一般用来设定build环境,通过Terminal > Configure Default Build Task呼出task.json文件,官网给出的例子如下:

      

    {
      "version": "2.0.0",
      "tasks": [
        {
          "type": "shell",
          "label": "cl.exe build active file",
          "command": "cl.exe",
          "args": [
            "/Zi",
            "/EHsc",
            "/Fe:",
            "${fileDirname}\${fileBasenameNoExtension}.exe",
            "${file}"
          ],
          "problemMatcher": ["$msCompile"],
          "group": {
            "kind": "build",
            "isDefault": true
          }
        }
      ]
    }

      这里command用来指定要执行的程序,args字段用于记录执行command需要涉及到的参数。isDefault = true指定该tasks.json是(command + shift + b)快捷键执行的默认task。这里有更多详细的task.json的参数介绍。

    lauch.json

      用来debug程序,快捷键为f5,通过Run > Add Configuration呼出lauch.json。官方给出的案例如下:

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "cl.exe build and debug active file",
          "type": "cppvsdbg",
          "request": "launch",
          "program": "${fileDirname}\${fileBasenameNoExtension}.exe",
          "args": [],
          "stopAtEntry": false,
          "cwd": "${workspaceFolder}",
          "environment": [],
          "externalConsole": false,
          "preLaunchTask": "cl.exe build active file"
        }
      ]
    }

      program字段用来制定需要执行的程序。其余字段详见这里

      debug的例子还是看官方文档比较好,https://code.visualstudio.com/docs/cpp/config-msvc#_step-through-the-code

  • 相关阅读:
    coffee.js
    domOperation.js
    ImmediateFunc.js
    callback.js
    array.js
    asynchronous.js
    addEventListener.js
    meta的日常设置
    11.11 双十一 前端教你一键领取天猫千张优惠券 (领前先想想有没有钱花这些优惠券)
    前端的最后是逻辑和数学
  • 原文地址:https://www.cnblogs.com/z1141000271/p/14963333.html
Copyright © 2011-2022 走看看