Skip to content

added fullTypeCheckFlag to TypeChecker#450

Merged
vladima merged 4 commits intomasterfrom
fullTypeCheckFlag
Aug 15, 2014
Merged

added fullTypeCheckFlag to TypeChecker#450
vladima merged 4 commits intomasterfrom
fullTypeCheckFlag

Conversation

@vladima
Copy link
Copy Markdown
Contributor

@vladima vladima commented Aug 13, 2014

LS now uses 2 instances of typechecker:

  • typeInfoResolver - created via getTypeChecker(/*fullTypeCheck*/ false) - used by quickinfo\dot completion etc..
  • fullTypeCheckChecker - created via getTypeChecker(/*fullTypeCheck*/ true) - used to get semantic diagnostics.

fullTypeCheck parameter in the getTypeChecker controls if typechecker can shortcut and answer more quickly (producing less error messages but they are still ignored when fullTypeCheck === true)

Comment thread src/compiler/checker.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we instead just augment checkTypeAssignableTo to check the fullTypeCheck flag?

Comment thread src/services/services.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not create it here. create it on demand. this will do a full bind, and unless the current operation is getSemanticDiagnositcs, this is wasted.

Comment thread src/services/services.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not really care for the name that much. and this is used in only one place, so the extra layer of abstraction, is not really useful, i would just put it in getSemanticDiagnostics, to recreate if it does not exist and forget about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference in avoiding errors is to leave only one way that will do things right. Since accessing variable directly might fail without prior check - then this only was should be "always use function, do not touch the variable"

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Aug 15, 2014

👍

vladima added a commit that referenced this pull request Aug 15, 2014
added fullTypeCheckFlag to TypeChecker
@vladima vladima merged commit a52cdaf into master Aug 15, 2014
@vladima vladima deleted the fullTypeCheckFlag branch August 15, 2014 19:14
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants