saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.03k stars 5.47k forks source link

[FEATURE REQUEST] VSCode autocomplete plugin #56622

Open gigi206 opened 4 years ago

gigi206 commented 4 years ago

All other similar tools (puppet, ansible, chef) have autocomplete tools: cf https://youtu.be/oTNpobsCCS0?t=295

I think it would be a good point to develop a tool to help developers use Saltstack.

mchugh19 commented 4 years ago

Timely report @gigi206! The saltstack vscode extension was just updated to support autocomplete of state modules for sls files, as well as test entries for saltcheck tst files. Additionally, you should now use the saltstack extension pack to ensure you have both the saltstack syntax and autocomplete plugin as well as the salt-lint plugin (which lints sls files).

gigi206 commented 4 years ago

Great 👍 I'm going to update my extensions that already include these two to test 😊

gigi206 commented 4 years ago

I just test. It would be great if we could show the associated documentation when I put the mouse cursor above the function, for example:

my_surper_user:
  user.present:
    - name: gigix
    - uid: 1010

should return:

import salt.states.user
user.present.__doc__

Same thing for user:

import salt.states.user
user.__doc__

And same thing for user, but in this case, a parser is needed to extract the good value.

Also autocomplete required arguments when we press enter:

id:
  <state>.<function>: <<<<ENTER HERE

and this is autocomplete required arguments like:

id:
  <state>.<function>:
    - <args1>: aaa
    - <arg2>: bbb

We have just tp press tab to change aaa and bbb value

Take a look at ansible extension: ansible