• Visual Studio Code-GO tasks 设置 (实现在vsc下直接编译输出的功能)


    Visual Studio Code -GO 使用过程中发现,如果要编译输出某个文件需要去cmd窗口才行,感觉特别麻烦网上一直没找到解决办法,这几天查看Visual Studio Code文档发现它提供 tasks 功能可以实现

    需要了解Visual Studio Code所有功能配置是通过json文件配置的

    tasks 工作原理是Visual Studio Code 自动执行你之前配置好的功能。

    配置方法

    第一次使用 打开vsc界面按 快捷键 Ctrl+Shift+B 会弹出 
     

    点击配置任务运行程序 
      
    点击Others 
      
    出现这个就是我们的配置文件,我们只要把我们的go语言的编译命令配上就行了 
    我的配置文件 tasks.json 更详细配置:http://code.visualstudio.com/docs/editor/tasks 

    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
    {
    "label": "rungo",
    "type": "shell",
    "command": "go",
    "args": [
    "run",
    "${file}"
    ],
    //"showOutput":"always",
    "presentation":{
    "echo": true,
    "reveal": "always",
    "focus": false,
    "panel": "shared"
    },
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": []
    }
    ]
    }

     

    配置好后 Ctrl+Shift+B 就可以自动编译输出 测试: 

     

     

  • 相关阅读:
    hdu_5961_传递(bitset)
    hdu_5963_朋友(找规律)
    hdu_5968_异或密码(预处理+二分)
    hdu_5969_最大的位或(贪心)
    hdu_5965_扫雷(递推)
    hdu_5950_Recursive sequence(矩阵快速幂)
    hdu_5286_wyh2000 and sequence(分块)
    [BZOJ1951][SDOI2005]古代猪文(数论好题)
    [BZOJ2659][WC2012]算不出的算式(几何)
    [BZOJ 2656][ZJOI2012]数列(递归+高精度)
  • 原文地址:https://www.cnblogs.com/it-tsz/p/9021796.html
Copyright © 2020-2023  润新知