Skip to content

Instantly share code, notes, and snippets.

@jeremychone
Last active May 10, 2024 10:36
Show Gist options
  • Save jeremychone/af54178198474ff19608148f3dce309b to your computer and use it in GitHub Desktop.
Save jeremychone/af54178198474ff19608148f3dce309b to your computer and use it in GitHub Desktop.

Rust-Analyzer Customization Tips

Customize mutable style

Video - Rust Tip - Customize Mutable Colors in VSCode

In the settings.json add the following:

    "editor.semanticTokenColorCustomizations": {
        "enabled": true,
        "rules": {
            "*.mutable": {
                "underline": false,
                "foreground": "#d9bbfc"
            }
        }		
    },

Note: If you already have one or more "editor.semanticTokenColorCustomizations" rules already, just add the rule above.

Toggle inlay

edit: 2023-11-21

{
    "key": "cmd+u",
    "command": "toggle",
    "when": "editorTextFocus",
    "args": {
        "id": "toggle_inlay_hints",
        "value": [
            {
                "editor.inlayHints.enabled": "on"
            },
            {
                "editor.inlayHints.enabled": "off"
            }
        ]
    }
}
@bweis
Copy link

bweis commented Sep 21, 2023

Not sure that this works anymore. Can you confirm?

@jeremychone
Copy link
Author

jeremychone commented Sep 21, 2023

@bweis No, this is not working anymore. it's part of vscode.

And then, in my vscode key binding I use

	// Toggle inlays with Toggle: https://marketplace.visualstudio.com/items?itemName=rebornix.toggle
	{
    "key": "cmd+u",
    "command": "toggle",
    "when": "editorTextFocus",
    "args": {
        "id": "toggle_inlay_hints",
        "value": [
            {
                "editor.inlayHints.enabled": "on"
            },
            {
                "editor.inlayHints.enabled": "off"
            }
        ]
    }
	}
	```

@jeremychone
Copy link
Author

@bweis I updated the main gist with the correct info. I am delisting the youtube video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment