Autocomplete not working well in visual studio code

扶醉桌前 提交于 2020-12-26 07:43:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!