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 invalid unwrap when failing to create build file #1636

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

Techatrix
Copy link
Member

getBuildFile may return null when creating the build file failed.

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a6dbca2) 75.50% compared to head (f2c0e7c) 75.50%.

Files Patch % Lines
src/DocumentStore.zig 0.00% 1 Missing ⚠️
src/features/completions.zig 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1636   +/-   ##
=======================================
  Coverage   75.50%   75.50%           
=======================================
  Files          33       33           
  Lines        9034     9034           
=======================================
  Hits         6821     6821           
  Misses       2213     2213           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@llogick llogick left a comment

Choose a reason for hiding this comment

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

I know there are a few more call sites, are they covered?

@Techatrix Techatrix force-pushed the techatrix/fix-broken-build-file branch from 85c11e9 to dc2c5b9 Compare November 30, 2023 23:21
@Techatrix
Copy link
Member Author

I know there are a few more call sites, are they covered?

I've looked again and realized that I've missed one call and one of my changes was unnecessary which also applies to all the other callsites of getBuildFile which I didn't edit because of the following guarantee:

zls/src/DocumentStore.zig

Lines 160 to 162 in a3145f6

/// `DocumentStore.build_files` is guaranteed to contain this uri
/// uri memory managed by its build_file
associated_build_file: ?Uri = null,

`getBuildFile` may return null when creating the build file failed.
@Techatrix Techatrix force-pushed the techatrix/fix-broken-build-file branch from dc2c5b9 to f2c0e7c Compare December 1, 2023 17:36
Copy link
Contributor

@llogick llogick left a comment

Choose a reason for hiding this comment

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

Got it

@llogick llogick merged commit c7e6adc into master Dec 1, 2023
9 of 10 checks passed
@llogick llogick deleted the techatrix/fix-broken-build-file branch December 1, 2023 18:17
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