zoukankan      html  css  js  c++  java
  • 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 就可以自动编译输出 测试: 

     

     

  • 相关阅读:
    vue ui 没反应
    vue脚手架安装教程
    DOS命令如何进入指定文件夹
    python-格式化(%,format,f-string)输出+输入
    Python基础-列表、元组、字典、字符串(精简解析)
    python中的lambda函数用法
    初识JAVA
    关于继承、封装、多态、抽象和接口(Java)
    Python中单下划线和双下划线
    Postgresql 创建SEQUENCE,Springboot中使用KeyHolder
  • 原文地址:https://www.cnblogs.com/it-tsz/p/9021796.html
Copyright © 2011-2022 走看看