标签: visual-studio-code

如何使用VSC浏览Linux内核源代码

我正在从Eclipse CDT转换。当使用预处理器定义(无论是在Makefile中明确指定还是通过外部自动生成的头文件包含在内)在C / C ++代码中浏览时,预处理器宏功能是必需的。如果没有这个,就无法导航Linux源代码,如本开创性的Wiki页面上有关使用Eclipse研究Linux代码所述。我正在寻找VSC的等效功能。希望有一个指针。

带问候

preprocessor visual-studio-code

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

VS代码Intellisense支持PHTML文件中的内联css /内联javascript

几天后我使用的是Visual Studio Code,我想知道是否可以在' .phtml '文件中内嵌css-blocks和/或内联javascript中支持Intellisense .

正如你所看到的,只支持php

我无法在网上找到一个解决方案,只有少数人抱怨这个问题在几个月前没有起作用,但我对我没有任何帮助.
如果有人知道如何解决这个问题或者至少朝着正确的方向迈出一步,或者如果我必须将css和js移动到外部文件中(当然那更好(!)但是那不是这一点;))

提前致谢.

javascript css php intellisense visual-studio-code

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

运行构建任务/ TSC中的VSCode路径生成失败:构建

我正在通过https://code.visualstudio.com/docs/languages/typescript上的Typescript简介进行工作

当我尝试Run Build Task选择时tsc: build,VSCode尝试以下操作:

Executing task: tsc -p c:\work\JavascriptTypescript\test-apr-2018\tsconfig.json <

error TS5058: The specified path does not exist: 'c:workJavascriptTypescripttest-apr-2018tsconfig.json'.
The terminal process terminated with exit code: 1
Run Code Online (Sandbox Code Playgroud)

它试图使用tsconfig.json文件的完整路径,然后从该路径中删除斜杠。显然,这将找不到正确的文件。

如果我tsc -p tsconfig.json从命令行手动发出,则tsc可以正常工作。

这似乎是VSCode配置错误,但我是VSCode的新手,也不知道如何解决它。

typescript visual-studio-code

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

Visual Studio代码根据项目更改语言模式

如何根据我打开的项目改变visual studio代码中的语言模式?例如,在一个项目中,我想将语言模式设置为.js文件的标准javascript文件.在另一个项目中,我想设置语言模式以响应.js文件.

图片

javascript reactjs visual-studio-code vscode-settings

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

php配置:找不到PHP可执行文件

我想在VSCode中设置php.我不希望它在我的全局设置中,所以在工作区设置中我有:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "php.validate.enable": true,
        "php.validate.executablePath": "C:\\php\\php.exe",
        "php.validate.run": "onType"
    }
}
Run Code Online (Sandbox Code Playgroud)

我将PHP下载到c:\ php ...

在此输入图像描述

但是当我启动工作时,我仍然会收到此错误:

PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting
Run Code Online (Sandbox Code Playgroud)

php visual-studio-code

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

Vue Prop没有初始化程序,并且在构造函数中未明确分配

我在Vue类组件中使用道具。道具是在构造函数中定义的,没有值。这可以编译并正常工作,但是由于最新的VS Code / TSLint更新,我收到以下警告:

属性“标签”没有初始化程序,并且在构造函数中未明确分配。

Vue类组件

export default class Browser extends Vue {
  @Prop({default: '', required:false})
  tag: string

  created(){
     console.log("the tag prop is " + this.tag)
  }
}
Run Code Online (Sandbox Code Playgroud)

如果我确实分配它,则会收到Vue警告,提示您不应在子组件中操纵Prop。

[Vue警告]:避免直接更改prop,因为每当父组件重新渲染时,该值都会被覆盖

由于这似乎主要是棉绒问题,有没有办法禁用它?还是我的代码实际上是错误的?

typescript vue.js tslint visual-studio-code

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

名称空间'System.Threading'中不存在C#'Task'

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Task;`

`namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Console.ReadLine();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我只是想开始使用C#,当我编写helloworld时,我遇到了第一个编译错误.

错误:脚本编译失败.[CompilationErrorException]错误CS0234:名称空间'System.Threading'中不存在类型或命名空间名称'Task'(您是否缺少程序集引用?)

我在VScode中运行最新的.NET编辑.希望得到你的帮助.

c# visual-studio-code

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

VSCode python“未验证的断点”在调试期间?

我正在使用VSCode调试python应用程序。

我从启动调试器的地方有一个主要的python文件。我可以在此文件中放置断点,但是如果要将断点放置在主文件调用的其他文件中,则将其作为“未验证的断点”获取,调试器将忽略它们。

如何更改我的位置,launch.json以便能够在项目中的所有文件上设置断点?

这是我目前的情况launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}"
        },
        {
            "name": "Python: Attach",
            "type": "python",
            "request": "attach",
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "${workspaceFolder}",
            "port": 3000,
            "secret": "my_secret",
            "host": "localhost"
        },
        {
            "name": "Python: Terminal (integrated)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }, …
Run Code Online (Sandbox Code Playgroud)

python breakpoints visual-studio-code vscode-settings vscode-debugger

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

Ubuntu 18.04上的Visual Studio代码安装错误

尝试在Ubuntu 18.04上安装Visual Studio代码时出现以下错误.

dpkg: dependency problems prevent configuration of code:
 code depends on libgconf-2-4; however:
  Package libgconf-2-4:amd64 is not configured yet.
Run Code Online (Sandbox Code Playgroud)

我该如何配置libgconf2?

visual-studio-code ubuntu-18.04

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

如何调试Visual Studio Code扩展?

解决和调试Visual Studio Code的最佳方法是什么?

在Visual Studio Code中进行编辑时,我在某些代码片段/建议扩展中遇到了冲突,想尝试找到根本原因。

附言:我很高兴能解决扩展之间的冲突。如果您之前曾遇到过此问题,请随时鸣叫(几秒钟后内置建议完全覆盖扩展建议)

visual-studio-code vscode-extensions

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