Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --strictNullChecks error with getDefaultProjectForFile #25060

Merged
2 commits merged into from
Jun 22, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 18, 2018

This is essentially two different functions with a flag to choose between them. Now that we have --strictNullChecks, this is a problem because the return type needs to be different in each case. This PR breaks out the two separate functions which can be called directly.

@ghost ghost requested a review from sheetalkamat June 18, 2018 21:43
ghost pushed a commit that referenced this pull request Jun 18, 2018
@ghost ghost force-pushed the ensureDefaultProjectForFile branch from b5bac59 to a94e57f Compare June 18, 2018 21:51
return ensureProject ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName);
}

tryGetDefaultProjectForFile(fileName: NormalizedPath): Project | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

i would mark these as /* @internal */. both tryGetDefaultProjectForFile and ensureDefaultProjectForFile

@ghost ghost merged commit 38a60ac into master Jun 22, 2018
@ghost ghost deleted the ensureDefaultProjectForFile branch June 22, 2018 18:22
ghost pushed a commit that referenced this pull request Jun 25, 2018
)

* Make GetEditsForFileRenameRequestArgs not extend FileRequestArgs

* Code review: check new location first, and use scriptInfo.getDefaultProject()

* Remove changes to e getDefaultProjectForFile (now #25060)

* Undo API changes (#24966)

* Combine edits from all projects (fixes #25052)

* Update API (#24966)

* Ignore orphan projects or projects with language service disabled
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants