akamud / vscode-theme-onedark

VSCode Theme based on Atom's One Dark theme
MIT License
293 stars 200 forks source link

Declare `InlayHint` colours #146

Closed cyqsimon closed 2 years ago

cyqsimon commented 2 years ago

VSCode now enables themes to define colours for inline hints (parameter & type). Unfortunately the default values don't fit One Dark particularly well:

image

They are hints and should be much subtler than that.

So I took a look at One Dark Pro and based my values off theirs (see here). I lowered the contrast a bit to my liking.

"editorInlayHint.background": "#2c323d",
"editorInlayHint.foreground": "#9ba1ad",

Declaring them makes it look much nicer:

image

Sample code

Taken from sharkdp/bat:

You will need to install the Rust toolchain and rust-analyzer to see the hints though, so this may not be the best example. Any supported language with type inference should do.

    let mut report = bugreport!()
        .info(SoftwareVersion::default())
        .info(OperatingSystem::default())
        .info(CommandLine::default())
        .info(EnvironmentVariables::list(&[
            "SHELL",
            "PAGER",
            "LESS",
            "LANG",
            "LC_ALL",
            "BAT_PAGER",
            "BAT_CACHE_PATH",
            "BAT_CONFIG_PATH",
            "BAT_OPTS",
            "BAT_STYLE",
            "BAT_TABS",
            "BAT_THEME",
            "XDG_CONFIG_HOME",
            "XDG_CACHE_HOME",
            "COLORTERM",
            "NO_COLOR",
            "MANPAGER",
        ]))
        .info(FileContent::new("Config file", config_file()))
        .info(FileContent::new(
            "Custom assets metadata",
            custom_assets_metadata,
        ))
        .info(DirectoryEntries::new(
            "Custom assets",
            PROJECT_DIRS.cache_dir(),
        ))
        .info(CompileTimeInformation::default());

Filename and Language selected

Rust (.rs)

Versions used

wentwrong commented 2 years ago

For anyone stumbling upon the inlay hints coloring problem for js and ts:

  1. Open settings.json file (Ctrl + Shift + P -> Preferences: Open Settings (JSON))
  2. Add the following lines
    "javascript.inlayHints.parameterNames.enabled": "all",
    "typescript.inlayHints.parameterNames.enabled": "all",
    "workbench.colorCustomizations": {
    "[Atom One Dark]": {
        "editorInlayHint.background": "#2c323d",
        "editorInlayHint.foreground": "#9ba1ad"
    }
    }
joeyame commented 2 years ago

@akamud

This is definitely a big issue and could be fixed with a max of 30 mins of work. I'd be happy to do it, but only if it would eventually get merged. Seeing the two pull requests open for the last two years is worrying though. Is this still maintained?

For others looking for an alternative, just get the One Dark Pro theme. Looks pretty similar and they declare inlayHints correctly.

akamud commented 2 years ago

This is now fixed in 2.3.0.