FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix checker initialization crash by andrewbranch · Pull Request #46973 · microsoft/TypeScript · GitHub

Fix checker initialization crash - #46973

Merged
Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:bug/46587
Dec 3, 2021
Merged

Fix checker initialization crash#46973
Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:bug/46587

Conversation

Copy link
Copy Markdown
Member

Fixes #46587

The auto import provider was trying to generate spelling suggestions for IArguments since it runs with noLib: true. Not sure why this happens only sometimes, but (a) there’s no point in trying to come up with spelling suggestions for global symbols, and (b) there’s no point in trying to come up with spelling suggestions for anything inside a non-diagnostics-producing checker.

Wesley Wigham (weswigham) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The work we do when producing diagnostics sometimes has side effects, like pushing things into caches, which can affect other calculations down the line, so I'm usually wary against produceDiagnostics checks that aren't immediately around an error call, as it can the a source of reeeeeaaally hard to track bugs where hover info and error info on a symbol don't match (hover data comes from a non-diagnostics producing checkers, while errors do). Specifically here, there's a nested conditional checkResolvedBlockScopedVariable that might toss something into a cache which now we'd avoid doing - it's probably fine until proven otherwise, since everything in the guarded branch is supposed to just be to generate an error message, I'd just keep it in mind in case something weird crops up in the future.

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) cherry-pick this to release-4.5

TypeScript Bot (typescript-bot) commented Dec 3, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the task to cherry-pick this into release-4.5 on this PR at 2064b74. You can monitor the build here.

Copy link
Copy Markdown
Contributor

Hey Andrew Branch (@andrewbranch), I've opened #47005 for you.

TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request Dec 3, 2021
Component commits:
0612e18 Fix checker initialization crash

2064b74 Move checks to a place that makes more sense
Andrew Branch (andrewbranch) merged commit 240ba0a into microsoft:main Dec 3, 2021
Andrew Branch (andrewbranch) added a commit to typescript-bot/TypeScript that referenced this pull request Dec 3, 2021
Component commits:
0612e18 Fix checker initialization crash

2064b74 Move checks to a place that makes more sense
Daniel Rosenwasser (DanielRosenwasser) pushed a commit that referenced this pull request Dec 7, 2021
Component commits:
0612e18 Fix checker initialization crash

2064b74 Move checks to a place that makes more sense

Co-authored-by: Andrew Branch <andrew@wheream.io>
Comment thread src/compiler/checker.ts
excludeGlobals = false): Symbol | undefined {
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
excludeGlobals = false,
getSpellingSuggstions = true): Symbol | undefined {

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm obviously very late to this PR but is this argument ironically named? 😛

Martin Probst (mprobst) pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
* Fix checker initialization crash

* Move checks to a place that makes more sense
Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TS Server fatal error: Cannot read property 'flags' of undefined

4 participants


Back | FazBrowse Home | New Git URL