问题
I'm getting started with Visual Studio Code and have been a user of Atom. One thing I've noticed, particularly with autocomplete for PHP, I have to scroll through a list of options in order to find the option to automatically fill in code. I want to get the autocomplete just by hitting tab.
Say, for example, I want to make an if
statement. In Atom, I just type "if" then hit tab and it will fill in the code with everything I need. In VS Code, if I type "if" followed by tab, nothing will happen. I would have to first scroll to the specific option. Is there a way to just get autocomplete by typing in the keyword then pressing tab?
This issue also applies to elseif
, else
, while
.
回答1:
It sounds like you're wanting snippets. You can add them yourself, or you can install an extension from the marketplace that will come with a number of popular snippets baked in.
You may be interested in changing the settings below as well, controlling how tab works and whether or not snippets appear first in the suggestions.
editor.snippetSuggestions
editor.tabCompletion
Open settings with ⌘,
on mac, or Ctrl+
on Windows. Then search for the setting and click the edit icon next to the result.
来源:https://stackoverflow.com/questions/51308647/autocomplete-not-working-well-in-visual-studio-code