标签: visual-studio-code

在Mac上的Visual Studio代码中更改默认终端应用程序

我想更改Visual Studio Code for Mac使用的默认终端应用程序.我认为它是偏好或设置json的一部分,但不确定.

terminal iterm2 visual-studio-code

41
推荐指数
5
解决办法
4万
查看次数

如何在Visual Studio代码中执行git push?

有一个"推"菜单项,但是当我点击它时,除了一个微妙的进度条显示并且从未完成之外没有任何反应.从Visual Studio Code的Docs页面,我发现这一行:"凭证管理目前不由VSCode处理",该页面链接到凭证助手上的GitHub页面,这对于其他远程服务器来说太具体了(在我的情况下,bitbucket) )并没有具体说明如何设置VS代码.

git visual-studio-code

41
推荐指数
4
解决办法
5万
查看次数

如何在VSCode(Visual Studio代码)中一起调试HTML和JavaScript?

我在VSCode中有一个非常简单的项目,一个链接到单个app.js文件的index.html文件.

当我点击F5时,我想运行和调试这个迷你网站.

如何配置VSCode以在浏览器中打开index.html,然后允许我在app.js中设置断点,这些断点将由我在浏览器中与应用程序的交互触发?

在Visual Studio中,这将"正常工作",因为它会启动自己的Web服务器IIS Express.在VSCode中,我不确定如何设置launch.json和/或tasks.json来创建一个简单的node.js Web服务器并提供index.html.

我已经看到了调试javascript应用程序的一些示例,例如这个launch.json:

{
    "version": "0.1.0",
    "configurations": [
        {
            "name": "Launch Bjarte's app",
            "type": "node",
            "program": "app.js",
            "stopOnEntry": true,
            "args": [],
            "cwd": ".",
            "runtimeExecutable": null,
            "runtimeArguments": [],
            "env": {},
            "sourceMaps": false
        },
        {
            "name": "Attach",
            "type": "node",
            "address": "localhost",
            "port": 5858,
            "sourceMaps": false
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

这将运行js文件,但我不明白我如何与应用程序进行交互.

debugging visual-studio-code

41
推荐指数
3
解决办法
4万
查看次数

只有'amd'和'系统'模块与--out一起支持

在VSCode中构建typescript时,我收到以下错误:

错误TS6082:在--out旁边只支持'amd'和'system'模块.

我的设置如下:

tsconfig.json

{
    "compilerOptions": {
        "target": "ES5",
        "module": "commonjs",
        "out": "current/game.js",
        "removeComments": true,
        "sourceMap": false
    }
}
Run Code Online (Sandbox Code Playgroud)

.vscode/tasks.json:

{
    "version": "0.1.0",

    // The command is tsc. Assumes that tsc has been installed using npm install -g typescript
    "command": "tsc",

    // The command is a shell script
    "isShellCommand": true,

    // Show the output window only if unrecognized errors occur.
    "showOutput": "silent",

    // args is the HelloWorld program to compile.
    "args": [],

    // use the standard tsc problem matcher to …
Run Code Online (Sandbox Code Playgroud)

typescript phaser-framework visual-studio-code

41
推荐指数
1
解决办法
2万
查看次数

在Visual Studio Code中显示文件选项卡中的路径

我的项目中有一个基于组件的文件夹结构.一堆组件文件夹,index.js每个文件夹有一个文件.是否可以使VSCode在文件选项卡中显示父文件夹名称?或者我只能看到一堆所有显示的标签index.js而没有别的?

在此输入图像描述

visual-studio-code

41
推荐指数
4
解决办法
1万
查看次数

如何在vs代码中显示完整文件git责备

有一次,我找到了一种在vscode中显示逐行git责任的方法.我现在不记得或找到了做到这一点的手段.我有Git Blame扩展,但这只会在单个选定的行上显示出责任.

git visual-studio-code

41
推荐指数
6
解决办法
2万
查看次数

vscode如何将多线紧凑到单线?

我在vscode中有这样的4行:

1行;
2行;
3行;
4行;

vscode是否有快捷方式可以快速将4行压缩为1行,如下所示:

1行; 2行; 3行; 4行;

keyboard-shortcuts visual-studio-code

41
推荐指数
2
解决办法
2万
查看次数

两次打开同一目录

在命令行上,我可以打开一个目录,如:

    code .
Run Code Online (Sandbox Code Playgroud)

现在,我希望在另一个窗口中打开并显示两个相同的指令.
(它没有拆分编辑器)
然后,我又试了一次.

    code .
Run Code Online (Sandbox Code Playgroud)

没啥事儿.
还有一个目录已打开.
如何实现这样的任务?

visual-studio-code

41
推荐指数
5
解决办法
7834
查看次数

如何让flake8可靠地忽略VS Code中的规则?

有两件事让我烦恼.首先是当我在一行上输入超过80个字符时Flake8给出的警告.第二个是我尚未使用我导入的模块名称时收到的警告.我查看了终端中使用Flake8的所有文档.没用

flake8 --ignore=E402
flake8 --max-line-length=120
Run Code Online (Sandbox Code Playgroud)

这不起作用.至少VS Code没有显示任何效果.

flake8 visual-studio-code

41
推荐指数
5
解决办法
9966
查看次数

如何查看 Typescript 类型的完整扩展合同?

如果我有一个看起来有点像这样的类型集合,只会更详细:

type ValidValues = string | number | null
type ValidTypes = "text" | "time" | "unknown"

type Decorated = {
  name?: string | null
  type?: ValidTypes
  value?: ValidValues
  title: string
  start: number
}

type Injected = {
  extras: object
}

// overriding the types from Decorated
type Text = Decorated & Injected & {
  name: string
  type: "text"
  value: string
}
Run Code Online (Sandbox Code Playgroud)

我的实际代码还有更多内容,但这显示了核心思想。我不想必须相信自己才能使类型之间的关系恰到好处。Text在所有类型代数之后,我想要工具向我展示“评估”的类型定义。

因此,对于上面的示例,我希望 中指定的字段Text将覆盖该Decorated类型中先前的声明,并且我假设的工具提示的输出(我希望)会显示如下内容:

{
  name: string
  type: "text"
  value: string
  title: string …
Run Code Online (Sandbox Code Playgroud)

algebraic-data-types typescript visual-studio-code

41
推荐指数
2
解决办法
4532
查看次数