3

I'm using a reduced line height in VS Code to fit more code on screen, which has served me pretty well for my mostly-web work.

Now I'm dipping my toes into Rust and VS Code helpfully underlines mutable variables. The underline is pretty far from the text though and interferes with the next line:
underline interfering

VS Code is so very customizable, is there a way to move that line a few pixels up?

I'm not looking to disable it, but I would also consider alternative highlighting (e.g. background, bold, italics).

ikhvjs
  • 5,316
  • 2
  • 13
  • 36
kiw
  • 748
  • 1
  • 9
  • 18
  • Seems like VS Code is rendering a “below the entire box of the character” underline instead of a typographically traditional underline which would cross descenders. Unfortunate. – Kevin Reid Oct 26 '22 at 14:30

1 Answers1

1

I'm not sure what your VSCode settings are, but they are most certainly non-standard.

This is what it looks like at my screen: VSCode Underline

You can look at your settings by doing Ctrl + , and clicking Open Settings (JSON) in the top right corner.

Those are my settings:

{
    "breadcrumbs.enabled": true,
    "editor.formatOnSave": true,
    "editor.renderWhitespace": "boundary",
    "files.trimTrailingWhitespace": true,
    "files.trimFinalNewlines": true,
    "files.insertFinalNewline": true,
    "telemetry.telemetryLevel": "off",
    "window.titleBarStyle": "custom",
    "workbench.editor.showTabs": false,
    "workbench.editor.enablePreview": false,
    "workbench.editor.enablePreviewFromQuickOpen": false,
    "workbench.startupEditor": "none",
    "workbench.enableExperiments": false,
    "workbench.tree.indent": 24,
    "workbench.tree.renderIndentGuides": "always",
    "editor.detectIndentation": false,
    "crates.useLocalCargoIndex": false,
    "rust-analyzer.cargo.features": "all",
    "window.zoomLevel": 1
}

If you configured the line distance that short on purpose, I'm not sure if you can actually modify the underline position. You could disable the underline, however: How do I disable the underlining of Rust variables and their methods in Visual Studio Code?

But I think the underline serves an important purpose, so I myself would increase the newline distance in your editor.

Finomnis
  • 18,094
  • 1
  • 20
  • 27
  • Why yes, my settings are non-standard. I've said as much while asking for more non-standard settings ;) I agree that highlight is important, hence I wanted to fix it instead of turn off. The linked answer has the relevant part of the configuration, now I have bold mutables instead of crossed out code – kiw Oct 28 '22 at 19:00
  • Nice :) That works, I guess :) – Finomnis Oct 28 '22 at 20:29