zed icon indicating copy to clipboard operation
zed copied to clipboard

Gray out unused variables

Open cktang88 opened this issue 2 years ago • 3 comments

Check for existing issues

  • [X] Completed

Describe the feature

Gray out unused variables, such as the following in VS code attached (b is unused).

I believe most LSPs, including Pylance for python, has this info, we just need to show it in the editor, ideally configurable.

If applicable, add mockups / screenshots to help present your vision of the feature

image

cktang88 avatar Apr 21 '23 06:04 cktang88

+1, please also make this configurable for unused imports.

Here is an example:

What is happening now (Zed)

CleanShot 2024-02-27 at 12 38 08 on Zed — provider ts

CleanShot 2024-02-27 at 12 37 39 on Zed — provider ts

Code responsible

"themes": [
  {
    "name": "XY-Zed",
    "appearance": "dark",
    "style": {
      "unreachable": "#aca8aeff",
      "unreachable.background": "#262933ff",
      "unreachable.border": "#2b2f38ff",
     }
  }
]

What I would like to configure (VS Code)

CleanShot 2024-02-27 at 12 40 35 on Code — node_modulesetherssrc tsproviders — provider ts — 21cli

CleanShot 2024-02-27 at 12 41 15 on Code — node_modulesetherssrc tsproviders — provider ts — 21cli

Code responsible

"workbench.colorCustomizations": {
  "editorUnnecessaryCode.opacity": "#0000005e"
}

zarifpour avatar Feb 27 '24 17:02 zarifpour

Missing this a lot working with Python, specially with unused imports.

jfcalvo avatar Apr 05 '24 13:04 jfcalvo

Zed already supports greying out unused code right? (perhaps it got added over the past year?) At least it works for Javascript. The one remaining thing to support is customizing the opacity. Right now (code ref) it appears to be fixed at 0.3 which is too similar for my liking.

If it doesn't work for other languages perhaps the LSP isn't fully integrated.

MatthewScholefield avatar Jul 14 '24 10:07 MatthewScholefield

Current Zed does support graying out of unused variables, so I think I will close this issue out. Feel free to open a new issue explaining what sort of settings around this you'd like to see, if you would like that feature.

SCR-20240727-uqte

JosephTLyons avatar Jul 28 '24 03:07 JosephTLyons