Autocomplete and Extensions
Level 1 · The editor
What the colours in your code mean. How the editor guesses your next word, and how an add-on gives your editor a new skill.
Course contentsLesson 2 of 13
Level 1 · The editor
Level 2 · Checking and fixing code
Level 3 · Trying code out
Level 4 · Other people's code
Level 5 · Building the project
After this lesson you can
- Spot a typo from the colours
- Use autocomplete without trusting it blindly
- Install an extension safely
10 mincovers 3 glossary entries
Worth reading first: Code Editors and IDEs
What the colours, the guesses and the add-ons do
Three helpers turn a plain text box into a code editor. Syntax highlighting paints each part of the code its own colour. Autocomplete guesses the rest of a word, so you type pri and press Tab to get print. Extensions add new skills, like a whole new language. None of the three changes what the code does.
With syntax highlighting, keywords might be purple, text in quotes green and notes grey. The colours are not saved in the file. The file stays plain text, and the editor paints it fresh each time it opens. Another editor may use other colours for the same file.
The colours also catch typos. Leave out a closing quote, and the rest of the line, or the rest of the file, turns the colour of text in quotes. You see the slip before you run anything. A word that should be purple and is not is often spelled wrong.
Autocomplete knows the names in your code. Type pri and it offers print. It can also show what a function needs before you call it. Press Tab or Enter to take the guess. Newer editors use AI to suggest whole lines, or a whole block at once.
A guess is not a check. A name that is close but wrong still runs, and it makes a bug that is hard to see. Read each suggestion before you take it, the same way you would read a line a stranger wrote for you.
An editor extension is an add-on that gives the editor a new skill. One adds a language, like Python. Another shows a checker's warnings as you type. Others add themes, Git tools or AI helpers. You install them from a list inside the editor, or with one command.
An extension runs inside your editor, so it can read your files and any secret keys in them. Install the ones you need from makers you can check, such as the team that makes the language. Treat a free add-on from a stranger like a free app from a stranger.
$ code --install-extension ms-python.pythonWorked example
Jack finds a missing quote
Jack's page will not load, and the error points at line 80. He opens the file and sees that everything from line 12 down is green.
Line 12 has a quote that opens and never closes. He adds the missing quote, the colours snap back, and the page loads.
The words for this lesson3
Check yourself
Are the colours in my code saved in the file?
Finished this lesson?
Marking it complete also marks its 3 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.