nix-community / vscode-nix-ide

Nix language support for VSCode editor [maintainer: @jnoortheen]
https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide
MIT License
273 stars 23 forks source link

Mark unused attributes? #273

Closed wmertens closed 2 years ago

wmertens commented 2 years ago

I'm wondering if this extension can somehow leverage rnix-lsp to find out which attributes are unused in an expression.

Example:

let a=5; b=true; in b

would mark a as unused.

hall commented 2 years ago

I've not terribly familiar with language servers but just wanted to add that using nil, as mentioned in #274, marks attributes as unused (see inputs and pkgs in the screenshot below). So my guess is that whatever change needs to happen, should happen in rnix-lsp.

image

jnoortheen commented 2 years ago

As @hall has mentioned, the info would come from LSP servers.