How do I disable the underlining of Rust variables and their methods in Visual Studio Code? - visual-studio-code

How do I disable the underlining of variables and their methods, like shown above? I find it quite distracting.
I don't think this is a duplicate of Disable wavy underline in VS Code because it's not a wavy underline.

{
"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"*.mutable": {
"underline": false,
}
}
}
}
Fixed it by dumping the above in settings.json

Try adding the following line to settings.json
"editor.semanticHighlighting.enabled": false,

Related

How to preserve highlights after using `files.associations` on a specific file

I used files.associations in .vscode/settings.json to override "editor.formatOnSave": false for one specific file:
{
"files.associations": {
"path/to/my/file.html": "no_format_on_save"
},
"[no_format_on_save]": {
"editor.formatOnSave": false,
}
}
but now I lost the highlights related to html how can I put it back ? I tried having two associations with array or coma separated but it doesn't seem to work.
Thank you

Disable VSCode ESLint warnings, but keep formatting functionality

I am using VSCode's ESLint extension to fix and format my TS code. I would like to remove all the warnings (such as red underlines) from ESLint, because I find them really annoying and distracting.
Using the config
"eslint.enable": true,
removes all warnings, but also disables the formatting.
In VS Code settings you can define an entry called "eslint.rules.customizations" and provide an array of rules with a severity setting set to "off".
{
"eslint.rules.customizations": [
{ "rule": "<rule-name>", "severity": "off" }
],
}
For example, if you are trying to remove the red (error) or yellow (warn) squigglies for the rules "react/jsx-curly-brace-presence" and "prettier/prettier" you can configure the following:
{
"eslint.rules.customizations": [
{ "rule": "prettier/prettier", "severity": "off" },
{ "rule": "react/jsx-curly-brace-presence", "severity": "off" }
]
}

How to format on save with the Deno VSCode extension?

I am using the vscode-deno extension and eventhough I turned on deno.enable, deno.lint and deno.unstable in my vscode settings, it does not format my code on save, which I suppose is the expected behavior.
I instead used the RunOnSave extension to hack my way into running a deno fmt on file save, but I was wondering if there was a way to do that with the Deno extension alone?
My .vscode/settings.json:
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.ts$",
"cmd": "deno fmt ${file}"
}
]
}
}
Found it, I have to turn on formatting on save and specifying the Deno extension as the default formatter
{
"deno.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
}

Problem with oh-my-zsh arrows colors in vscode

I'm trying to modify a ZSH theme but there's something wrong with colors
I can see everything ok in windows terminal:
I also can see everything ok when I connect to my WSL with the vscode remote tool:
But when i'm in a local context this happens:
This is the relevant part of my vscode config:
"terminal.integrated.fontFamily": "DejaVuSansMono Nerd Font",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
"files.exclude": {
"**/.git": false
},
"terminal.integrated.shell.linux": "/usr/bin/zsh",
"gitlens.views.repositories.branches.layout": "list",
"window.zoomLevel": 0,
"workbench.colorCustomizations": {
"terminalCursor.background":"#C5C8C6",
"terminalCursor.foreground":"#C5C8C6",
// "terminal.ansiBlack":"#1D1F21",
"terminal.ansiBlue":"#27aecf",
"terminal.ansiBrightBlack":"#969896",
// "terminal.ansiBrightBlue":"#81A2BE",
// "terminal.ansiBrightCyan":"#8ABEB7",
// "terminal.ansiBrightGreen":"#B5BD68",
// "terminal.ansiBrightMagenta":"#B294BB",
// "terminal.ansiBrightRed":"#CC6666",
// "terminal.ansiBrightWhite":"#FFFFFF",
// "terminal.ansiBrightYellow":"#F0C674",
// "terminal.ansiCyan":"#8ABEB7",
"terminal.ansiGreen":"#438b43",
// "terminal.ansiMagenta":"#B294BB",
// "terminal.ansiRed":"#CC6666",
"terminal.ansiWhite":"#ffffff",
"terminal.ansiYellow":"#9e983c"
},
"materialTheme.accent": "Cyan",
"terminal.external.linuxExec": "zsh",
"python.terminal.activateEnvInCurrentTerminal": true
}
I'd love to fix the color of those triangles.
I've tried almost everything in my hand but now I have no clue of what to do...
Thanks in advance!
Okey I fixed it,
My problem was that in I needed to add a color for foreground in the vscode setting
"terminal.foreground":"#ffffff"
apparently the default color for this is some kind of grey and that's what it draw when you don't specify any color.

Disable intellisense for css classnames in .tsx/.ts files

Whenever I enter a . after a object the autocomplete dropdown contains a lot of unnecessary css classnames as options:
Is it possible to ignore css files for ts/tsx intellisense, so i only get relevant options?
VS Code version: 1.37.1
"[typescript]": {
"editor.suggest.showClasses": false
},
"[typescriptreact]": {
"editor.suggest.showClasses": false
}
Basically the same as Mark's answer but it looks like "editor.suggest.filteredTypes" has been deprecated since VSCode >= 1.40 in favor of settings like "editor.suggest.showClasses".
Try something like this in your settings:
"[typescript]": {
"editor.suggest.filteredTypes": {
"class": false,
}
},
"[typescriptreact]": {
"editor.suggest.filteredTypes": {
"class": false,
}
}
[it would be nice if you could combine these but [typescript, typescriptreact] didn't work for me.
From types of completions it looks like it is class that you want to filter out.
And see create language-specific settings to see how to create settings for specific languages.
You will have to reload vscode to see these changes take effect.