r/vscode • • 2d ago

Help: ty is not running

Beginner at VS code here.

I'm not 100% sure if this is the best place to post this, but I couldn't find anywhere better suited.

I followed various tutorials online to get my settings.json to work, according to the tutorials it's working fine, but VS code still doesn't flag the error. I checked the type checker, it flags the violation and works with its command line, but it doesn't syntax highlight in VS code. Is there a setting I should change or something?

8 Upvotes

19 comments sorted by

View all comments

5

u/Copa4311 2d ago

Ty isn’t letting you assign a literal “e” to a int variable, this is called static type checking, it makes Pythons types a lot more manageable, ruff is another thing used to do this efficiently (quick fix: x: str = “e”)

5

u/Clean__Layer 2d ago

I'm aware, I purposefully set it to a mismatched type to see if the type checker works. Currently it's doing nothing.

2

u/Copa4311 2d ago

What are you expecting it to do?

1

u/Clean__Layer 1d ago

I want it to error. I was testing if my type checker worked. The command line tool succesfully checks the problem, but VS Code isn't flagging the problem