Issue #48 (Customizing IntelliSense)03/22/23
Most developers probably make use of IntelliSense in their daily coding, which allows you to easily auto-complete your code as you type certain words, function names, etc.
I've mentioned a little bit about these features before, but let's look at a couple other
ways to customize your IntelliSense features. First, search for "acceptSuggestion" in your settings and notice the two settings that appear.
The
Accept Suggestion on Commit Character setting is a bit of a strange one. This allows you to autocomplete a suggestion by typing that language's
commit character. In JavaScript, this would be a semi-colon. The problem with this is that it doesn't always work and there doesn't seem to be a way to change the commit character. This is on by default, but because it's not consistent in being triggered, it probably isn't the best way to use IntelliSense.
The other setting is for choosing whether to
Accept Suggestions on Enter. By default you can use the TAB or ENTER keys to accept a suggestion via IntelliSense. If you find you'd rather not confuse the use of the enter key (which you'll obviously be using for new lines), then you can disable this.
You can also set this to "smart", which means VS Code will accept the suggestion only if a textual change is made. This is useful if you have finished typing the name of something that would normally be auto-suggested, then you press ENTER to go to the next line. If you're in the middle of typing the word, the ENTER key will auto-complete. But if you're at the end of typing the word, the ENTER key will create a new line. It's a subtle difference, and my explanation might be a bit confusing, but might help in your workflow. Feel free to try it out to see if you like the change.
Another one you might want to consider adjusting is the setting called
editor.tabCompletion. This one is off by default but if you have Quick Suggestions enabled, you won't notice. Quick Suggestions are displayed in a drop-down as you type, so technically your TAB key will work for those.
However, with Quick Suggestions off, you can enable Tab Completion to allow you to use the TAB key to insert the best suggestion inline automatically, without seeing a list of suggestions. You can also continue to hit the TAB key to cycle through the different suggestions inline, again with no list visible. This might take some getting used to if you're accustomed to using the drop-down auto-complete, but it's an option to consider if you find the drop-down distracting or something.
Now on to this week's hand-picked links!