Need help with autocomplete and Chef cookbooks


#1

Not a developer by trade, writing Chef cookbooks and having problems lately, especially creating custom resources. I have “language-chef” installed plus 9 other community packages.

If I type:

custom_resource 'blah do
action: install

at “install” I get a bunch of options and none are just “install”.

Then when I finish the resource with “end”, “end” isn’t an option but 3 other things come up that contain “end” in them. I’m constantly having to press the ESC key to cancel what it’s recommending and it’s starting to drive me crazy.

Can I either add the things I want to autocomplete list? or re-order that list somehow? Thanks in advance.


#2

The completions you see are probably defined in the language-chef package, unless you have an autocomplete package for chef as well (in which case they may come from there too).

I recommend changing the completion setting from tab and enter to just tab. It took me some getting used to when I first did it, but now I use it without a problem. This setting is in the autocomplete-plus package.

You can add custom snippets in your snippets.cson file. The syntax is described in the flight manual, but if you have a specific goal you can ask here and we’ll try to help.

I don’t think that’s possible. The order is based on the “score” of the word according to what’s already been typed, which basically puts the closest matching completions on top.


#3

Thank you for the fast reply! Will look into those recommendations immediately.