microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.7k stars 29.45k forks source link

Nothing in VS Code is working #167972

Closed BFoor closed 1 year ago

BFoor commented 1 year ago

Nothing in VS Code is working as I am unable to make any customizations or updates as seen in this instructional video: https://www.youtube.com/watch?v=fJEbVCrEMSE

I get the same error for anything/everthing: "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again." When I open user settings, there is nothing to indicate what needs to be done to get the error fixed. What do I need to do?

rzhao271 commented 1 year ago

Can you paste your user settings?

BFoor commented 1 year ago

please provide instructions on how to do that.

BFoor commented 1 year ago

Is this what you mean?

`{ "window.zoomLevel": 1, "editor.wordWrap": "on", "atomKeymap.promptV3Features": true, "editor.multiCursorModifier": "ctrlCmd", "editor.autoSurround": "never", "editor.acceptSuggestionOnCommitCharacter": false, "editor.inlineSuggest.enabled": false, "editor.quickSuggestions": { "other": "off" }, "editor.suggest.matchOnWordStartOnly": false, "editor.autoClosingQuotes": "never", "editor.find.cursorMoveOnType": false, "diffEditor.wordWrap": "on", "editor.lightbulb.enabled": false, "workbench.settings.useSplitJSON": true, "workbench.colorTheme": "Sublime Material Theme - Dark", "launch": {

    "configurations": [],
    "compounds": []
}

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": [
            "comment.block.html", 
             ],
             "settings": {
             "foreground": "#62DD84",
             "fontStyle": "bold",
             }
        },
    ]
}

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": [
             "meta.tag.structure.p.start.html", 
             ],
             "settings": {
             "foreground": "#269188",
             }
        },
    ]
}

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": [
             "meta.tag.inline.a.start.html", 
             ],
             "settings": {
             "foreground": "#eb3d1d",
             }
        },
    ]
}

}`

rzhao271 commented 1 year ago

The textMateRules don't look right to me. I pasted your text into my user settings.json file and immediately got errors showing up: Screenshot showing the Settings JSON file with errors

When I open user settings, there is nothing to indicate what needs to be done to get the error fixed.

The link should redirect you to the JSON file. Can you confirm that's what's happening?

BFoor commented 1 year ago

I don't understand what you're asking of me. I'm in the settings and I don't get that error in the Json settings that your screenshot is showing.

BFoor commented 1 year ago

Anyway, I deleted all of that tokenColorCustomizations & i'm not getting the error anymore.

BFoor commented 1 year ago

I need to customize color for elements in HTML files, like URLs, comments (also remove italics), etc. Can you please provide up to date & accurate instructions on how to accomplish that? Thank you.

rzhao271 commented 1 year ago

I don't understand what you're asking of me. I'm in the settings and I don't get that error in the Json settings that your screenshot is showing.

The lack of an error doesn't sound right. Can you post a screenshot of how the JSON file looks when you have https://github.com/microsoft/vscode/issues/167972#issuecomment-1335920379 as the setting contents?

As for customizing the colours, what you want to do is have a single editor.tokenColorCustomizations setting instead of three of them. Since textMateRules is an array, you can put the three customizations all into that array, rather than duplicate the editor.tokenColorCustomizations and textMateRules keys.

BFoor commented 1 year ago

Here is what I have now, without error.

Vsc-Jason-Settings_12-5-2022

rzhao271 commented 1 year ago

I confirm there's no errors with your simplified configuration above. Here's an example of writing multiple Textmate rules without causing errors in the settings.json file

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": [
            "comment.block.html"
        ],
        "settings": {
            "foreground": "#62DD84",
            "fontStyle": "bold"
        }
    }, {
        "scope": [
            "meta.tag.structure"
        ],
        "settings": {
            "foreground": "#269188",
            "fontStyle": "bold"
        }
    }]
}