Bald Bearded Builder
vscode/spell-check-in-vs-code-with-code-spell-checker

Spell Check in VS Code with Code Spell Checker

Code Spell Checker finds mistakes in documentation, comments, variables, and function names while supporting quick fixes, custom dictionaries, additional languages, and targeted exclusions.

Loads from YouTube when you press play

Transcript 6 topics

Why spell checking matters

0:00

You've been there, you're writing some code or maybe some documentation, even a blog post in markdown, you finish, you commit your code, you push it up and then you create a pull request. And then you get a pull request review from a teammate that says, hey, you misspelled this word or that word, or all of these misspellings. And you're like, ugh, I've gotta go do a PR change now because of a misspelling. How did I let that slip first of all? And darn it, what a waste of my time.

I didn't realize it, but I perfect sure for today, mistakes were made. Those spelling mistakes eat up my time and they're not really even necessarily pertinent to the code. I guess it matters more if you're writing documentation or a blog post. Today's extension helps with all of that. Let's get to it.

Hello world. My name is Michael Jolley and I'm the bald bearded builder. I am excited to talk about Versus Code extensions. But before we get started, I just wanna remind you that we stream on Twitch three days a week, Tuesday, Wednesday, and Thursday, starting at 2PM Eastern. I think that's six GMT.

You can find us at twitch. TvBallBradyBuilder and we'd love for you to hang out with us there.

Code Spell Checker overview

1:19

Now let's get to it. Today, I'm talking about Code Spell Checker. It's one of those extensions that you really don't think about it until you need it. And then you're like, Ugh, why isn't this built in? But that's the great thing about extensions is they enhance all of this capabilities in Versus Code that aren't there natively.

The greatest thing about this is it's really kind of irrelevant what file type you're looking at. It could be a markdown file, you're doing documentation or a blog post. Maybe you're doing some JavaScript or wherever you're at your code comments, not just your comments though. It actually spell checks like variable names and function names.

It doesn't care about casing. It'll break apart things that are camel cased to make sure each segment is spelled correctly.

Installing the extension

2:06

Pretty smart stuff. So how do we install it? I've left a link in the description below if you wanna click on it and learn more about it. There are some functions and features there that we're not gonna discuss in the video today. So you may wanna learn more about them.

But the easiest way is always to press that extensions button, search for code spell checker and press the install button. Once it's there, it's just gonna kind of work. Open up some code or read me or whatever, open something up and it'll start spell checking it. It's got a built in dictionary and we can actually add to that. We'll talk about that later, but it just, it kinda works out of the box.

Misspellings are underlined and it'll show you words. It'll show you a message actually that says, I just don't recognize that word, which makes it pretty painless to use.

Quick fixes and dictionaries

2:55

One of the niceties is that you can quickly change the word without having to type it. If you right click and go to the little quick fix menu, it'll suggest some words that it thinks you meant and clicking that word will actually replace it in your file, which makes it really handy. But let's say that you actually meant what you typed. It wasn't a mistake. Well, then you can add it to a user or workspace dictionary.

This is awesome. If I've got some phrase that it's legitimate, this is some kind of name for a database that's just weird, but it's real. Then I can add it to a user or workspace area, I guess a dictionary. The difference is for a user dictionary, if I save it there, then any project I open on my machine, that word is gonna be considered a correct spelling. If I add it to the workspace dictionary, then it's going to only persist with that workspace.

So if I use that word in another code base, gonna consider a misspelling again. Do you need a language other than English? They have got you covered.

Language packs and medical terms

3:59

If you search the Versus Code marketplace for code spell checker, you'll find this extension, but you'll find tons of others. I mean, tons of others with different languages. We're talking German, Russian, Spanish, you name it, it's probably in there. Hopefully you can find exactly what you need. And one nicety I thought it was kind of cool.

If you're working in a medical field, there's another extension that's kind of an add on that adds common medical terms. That's a field that certainly has a lot of acronyms and words that built in dictionary just has no clue about. So being able to add that in and just not having to white list all that stuff, it would be real handy if you're doing that. So I'm not gonna go into all the customization but you can check that out in the link.

Ignore comments and words

4:42

Listen, there are a couple you need to know though. Say there's a line that you just wanna ignore or maybe in a file you wanna ignore. They've provided some neat little tricks with comments. You can add a comment before the line you wanna stop checking for spelling. And then whenever you're ready for spelling to checking to start back up, add in another comment and it'll start back up.

It's pretty easy. You can even tell it to ignore specific words in that file. But normally I would just rather add that to a dictionary and be done with it. That way it crosses over files. Are spelling errors kind of a pain point for you?

They always catch you like when you're not thinking about it, or at least in my case. Listen, if you liked this video be sure to hit the like button and subscribe, Ding the bell if you wanna see more videos about Versus Code extensions and other stuff. Thanks for hanging out with me until next time.

Sign in to join in. Reading needs nothing.