简体   繁体   English

我在VSCode上统一的工作区setting.json说在files.exclude之后需要'文件末尾'

[英]my workspace setting.json for unity on VSCode says 'end of file' expected after files.exclude

After setting VSCode as my editor and downloading the unity debugger extension, I deleted the original settings.json and replaced it with this one: 将VSCode设置为编辑器并下载统一调试器扩展后,我删除了原始settings.json并将其替换为以下代码:

 // Configure glob patterns for excluding files and folders.
 "files.exclude": {
    "**/.git": true,
    "**/.DS_Store": true,
    "**/*.meta": true,
    "**/*.*.meta": false,
    "**/*.unity": true,
    "**/*.unityproj": true,
    "**/*.mat": true,
    "**/*.fbx": true,
    "**/*.FBX": true,
    "**/*.tga": true,
    "**/*.cubemap": true,
    "**/*.prefab": true,
    "**/Library": true,
    "**/ProjectSettings": true,
    "**/Temp": true
} 

What i want is for only the CS scripts to show and hide the remaining (.unity,.prefab etc...). 我想要的只是CS脚本显示和隐藏其余(.unity,.prefab等...)。 I found this above code online that's meant to do that but there's an 'end of file expected' message on the colon after the files.exclude. 我在网上找到了上面的代码,这是要这样做的,但是在files.exclude之后,冒号上有一个“文件已结束”消息。 i guess a set of curly brackets is missing somewhere but where in the code is it meant to be? 我猜想在某个地方缺少花括号,但是在代码中这意味着什么呢?

I actually found what was missing and it happened to be that curly brackets also needed to encapsulate the whole code itself. 我实际上发现了所缺少的东西,恰好是大括号也需要封装整个代码本身。 That solved the problem. 那解决了问题。 Here is the corrected code with some extra files to exclude added: 这是经过纠正的代码,其中包含一些要排除的额外文件:

{
    "files.exclude": {
        "**/.git": true,
        "**/.DS_Store": true,
        "**/*.meta":true,
        "**/Library":true,
        "**/obj":true,
        "**/Temp":true,
        "**/ProjectSettings": true,
        "**/*.unityproj": true,
        "**/*.wav": true,
        "**/*.sln": true,
        "**/*.userprefs": true,
        "**/*.prefab": true,
        "**/*mat": true,
        "**/*fbx": true,
        "**/*.unity": true
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Unity 控制台显示“类型或命名空间定义,或文件结尾预期统一” - Unity Console says "type or namespace definition, or end of file expected unity" Unity 显示“错误 CS1022:类型或命名空间定义,或预期的文件结尾” - Unity says "error CS1022: Type or namespace definition, or end-of-file expected" 错误消息显示“类型或命名空间定义,或预期文件结尾” - Error Message says "Type or namespace definition, or end of file expected" Unity 给出“类型或命名空间定义,或预期文件结尾”错误 - Unity gives “Type or namespace definition, or end-of-file expected” error 类型或命名空间定义,或预期的文件结尾 (22,1) (UNITY) - Type or namespace definition, or end-of-file expected (22,1) (UNITY) (UNITY) 我的 JSON 文件在开始时没有加载 - (UNITY) My JSON file is not loading on start 错误 CS1022:类型或命名空间定义,或文件结尾预期的统一 3d 游戏引擎 - error CS1022: Type or namespace definition, or end-of-file expected unity 3d game engine 设置[PARAMETER]的值时出现意外结束-当在线验证者说字符串是无效的时,Visual Studio说字符串不是有效的JSON - Unexpected end when setting [PARAMETER]'s Value - Visual Studio says string is not valid JSON when online validators say it is Unity C# 错误:“类型或命名空间定义,或预期文件结尾” - Unity C# Error: “Type or namespace definition, or end-of-file expected” 适用于Unity3d的C#:3个无效令牌,名称空间不能直接包含…,并且文件结尾应为预期 - C# for Unity3d: 3x invalid tokens, name space cannot directly contain…, and end of file expected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM