标签: visual-studio-code

visual studio代码禁用自动换行长行

我使用vs代码用pylint编写python.当我按ctrl+ S(保存)时,编辑器将一条长行换成多行.如何禁用操作或将包装列计数配置为120(默认值为80)?我曾尝试"python.linting.pylintArgs": ["--max-line-length=120"]和"editor.wordWrapColumn": 120,但没有奏效.

python pylint visual-studio-code

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

VS Code:您信任此文件夹中文件的作者吗?

我刚刚启动 VS Code 1.57 并看到以下消息:“您信任此文件夹中文件的作者吗?”

你相信消息吗

为什么我会看到这条消息?

我应该信任当前的工作空间吗?

visual-studio-code

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

GitHub Copilot 可以停止自动建议,而是通过按键触发吗?

我发现 Github Copilot 在某些特定情况下非常有帮助,但在大多数情况下其冗长的内容却毫无帮助。

默认情况下,它始终处于打开状态,始终提供建议(并且经常妨碍我)。我希望它不那么激进,禁用自动建议,但仍然可以通过击键轻松使用它。

我已经尝试过的:

在一篇有用的文章中,我看到这Alt\是触发副驾驶建议的默认键。太好了,这就是解决方案的一半。

在 中settings.json,设置以下内容似乎完全禁用副驾驶!使用键盘快捷键不再可用。

    "github.copilot.inlineSuggest.enable": false
Run Code Online (Sandbox Code Playgroud)

我想知道这是否是一个错误,因为已经有多种方法可以完全禁用副驾驶。

keyboard-shortcuts autosuggest visual-studio-code github-copilot

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

错误:在工作区之外运行 Angular CLI 时此命令不可用

我对 Angular 还很陌生。但是当我尝试开始我的项目时

ng serve --open
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

错误

我的项目结构是这样的:

结构

可能是什么问题?

visual-studio-code angular

49
推荐指数
5
解决办法
34万
查看次数

Visual Studio代码:禁用引用包装文本选择

当我想从双引号更改为单引号时,我习惯选择双引号,然后键入单引号.我打算使用覆盖功能,但相反,我正在使用'wrap with quote'功能.

例如:

"id"
Run Code Online (Sandbox Code Playgroud)

会导致:

'"'id"
Run Code Online (Sandbox Code Playgroud)

我总是将这个自动环绕声关闭,但我无法在设置文件中找到此设置...

有没有办法把它关掉?

visual-studio-code vscode-settings

48
推荐指数
3
解决办法
1万
查看次数

如何使用Visual Studio Code连接到现有的git仓库

自从v0.9.1以来,我一直在使用Visual Studio代码很长一段时间.我现在已经遇到了使用GitHub和在线git repo的需要.

我有在线git repo设置并且已经使用GitHub推送到在线仓库.我最近意识到我可以使用VS代码同时执行这两项操作来节省自己:编辑我的代码,然后将其发送到在线仓库.

我对整个git概念都很陌生.VS代码让我安装了"GIT"插件,该插件安装了GIT Bash,GIT CMD和GIT GUI.

这是我想要访问的在线仓库网址:https://github.com/SpectrumGraphics/Spectrum-Graphic-Designs.git

VS Code GIT插件VS Code已安装

git github visual-studio-code

48
推荐指数
4
解决办法
13万
查看次数

在Visual Studio代码中选择匹配元素/重命名HTML标记

假设我有以下代码

<div class="footer"> <div>Foo</div> </div>

如何.footer从div元素更改为footer元素?

也就是说,如果我有光标,div我正在寻找一个选择元素的开始和结束标签的键盘快捷键.我相信我之前在Sublime中使用过emmet来做这件事,但我似乎无法在Code中找到类似的功能.(理想情况下,这也适用于JSX文件...)

visual-studio-code

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

Visual Studio代码自动导入

我正在从Webstorm迁移到Visual Studio Code.Webstorm中的表现非常糟糕.

Visual Studio代码对于找到我需要的依赖项并导入它们并不是很有帮助.到目前为止,我一直在手动执行此操作,但说实话,我宁愿等待15秒,以便webstorm找到并添加我的导入,必须手动挖掘它.

屏幕截图:找不到导入

我正在使用来自@ minko-gechev的angular2种子 https://github.com/mgechev/angular2-seed

我的baseDir中有一个tsconfig.json,如下所示:

    {
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "declaration": false,
    "removeComments": true,
    "noLib": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "pretty": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noFallthroughCasesInSwitch": true
  },
  "exclude": [
    "node_modules",
    "dist",
    "typings/index.d.ts",
    "typings/modules",
    "src"
  ],
  "compileOnSave": false
}
Run Code Online (Sandbox Code Playgroud)

我在我的src/client目录中有另一个看起来像这样:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "allowSyntheticDefaultImports": true
  }
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会有两个.angualr种子项目使用typescript gulp构建任务,所以我猜编译是不同的. …

typescript visual-studio-code angular

48
推荐指数
7
解决办法
7万
查看次数

如何在Visual Studio代码或VSCode中更改集成终端

我想改变集成终端, CMDER我在Windows 8.1上使用Vscode我检查了文档和偏好文件,但我混淆了所以从下面这行将改变它

//外部终端

// Customizes which terminal to run on Windows.
"terminal.external.windowsExec": "%COMSPEC%",

// Customizes which terminal application to run on OS X.
"terminal.external.osxExec": "Terminal.app",

// Customizes which terminal to run on Linux.
"terminal.external.linuxExec": "xterm",
Run Code Online (Sandbox Code Playgroud)

//集成终端

// The path of the shell that the terminal uses on Linux.
"terminal.integrated.shell.linux": "sh",

// The command line arguments to use when on the Linux terminal.
"terminal.integrated.shellArgs.linux": [],

// The path of the shell that the terminal uses on OS X.
"terminal.integrated.shell.osx": …
Run Code Online (Sandbox Code Playgroud)

preference visual-studio-code

48
推荐指数
4
解决办法
8万
查看次数

为什么.gitignore不会忽略我的文件?

见下图.我的.gitignore文件应该忽略src/dist中的所有文件,但不是.

在此输入图像描述

git gitignore visual-studio-code

48
推荐指数
8
解决办法
3万
查看次数