简体   繁体   中英

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:

 // 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...). 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. 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
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM