nixd icon indicating copy to clipboard operation
nixd copied to clipboard

nixd: code actions

Open inclyc opened this issue 1 year ago • 5 comments

  • [ ] add undefined variable as top-level formal
  • [ ] split an subexpression, with import ./file
  • [ ] with ..; let / inherit

inclyc avatar Apr 26 '24 07:04 inclyc

If I may request, a couple more:

  • [ ] flatten attrset:

    { foo = { bar = "foz"; } };
    

    to

    { foo.bar = "foz"; }
    
  • [ ] pack into nested attrset:

    foo.bar = "foz";
    foo.baz = "faz";
    

    to

    foo = { 
      bar = "foz";
      baz = "faz";
    };
    

VTimofeenko avatar Apr 28 '24 17:04 VTimofeenko

Thanks, any more ideas are welcomed!

inclyc avatar Apr 28 '24 17:04 inclyc

  • [ ] "remove unused definition" for the warning definition X is not used (sema-def-not-used)

LennyLizowzskiy avatar Jun 21 '24 21:06 LennyLizowzskiy

I use noogle.dev a lot. A "open in noogle.dev" code action would be neat for any function in the lib attribute set from nixpkgs

kpbaks avatar Oct 15 '24 20:10 kpbaks

from: https://github.com/oxalica/nil/blob/c8e8ce72442a164d89d3fdeaae0bcc405f8c015a/docs/code_actions.md

  • [ ] add_to_top_level_lambda_param Add an undefined name to the top-level lambda.
{ foo }: foo + bar

=>

{ foo, bar }: foo + bar
  • [ ] quote_attr and unquote_attr Rewrite between attribute names and double quoted strings
{ foo = bar; }

<=>

{ "foo" = bar; }

zspher avatar Oct 25 '24 08:10 zspher