huanghc
huanghc

Reputation: 23

How does vscode get Type Inference Result during using Typescript

I hava write some code write in vscode like:

function sum(a:number, b:number) {
  return a + b
}

Meanwhile, vscode give the user some tips which contains Type inference of this function return value.

enter image description here How does vscode get that auto type inference result, is there some lib or typescript API can get result?

Upvotes: 2

Views: 496

Answers (1)

Your VS code has TypeScript language server. You can find it in the bottom right corner enter image description here

Here you can find more information about language servers in VS Code

Upvotes: 1

Related Questions