meriton
meriton

Reputation: 70564

Taming Visual Studio Code IntelliSense

Suppose I'm writing a typescript expression, and realize the local variable I need doesn't exist yet. No problem, I think, let's simply finish typing the line before moving the cursor to type the variable declaration:

production: level.Sunlifter * 2 * perYear,

Alas, typing that final comma triggers IntelliSense, which helpfully changes my code to

production: level.Sunlifter * 2 * prepareSyntheticListenerName,

and imports

import { prepareSyntheticListenerName } from '@angular/compiler/src/render3/util';

Apparently, IntelliSense has realized that the characters of "perYear" appear in "prepareSyntheticListenerName" in nearly the same order ...

Can I somehow tell Visual Studio Code to be less permissive when matching imported identifiers?

Upvotes: 0

Views: 89

Answers (2)

Billy
Billy

Reputation: 1

Thanks, similar issue here. Escape is the only key that can maybe bypass those IntelliSense options.

Upvotes: 0

Michael Low
Michael Low

Reputation: 24506

Pressing esc before typing the comma is the only way I know of.

A workaround that may help is to configure VSCode to only import from certain packages. Then at least there's then less possible mistakes for it to make.

{
   "compilerOptions": {
       "types" : ["node", "lodash", "express"]
   }
}

https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

Upvotes: 1

Related Questions