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

config error reporting #1808

Merged
merged 4 commits into from
Mar 2, 2024
Merged

config error reporting #1808

merged 4 commits into from
Mar 2, 2024

Conversation

Techatrix
Copy link
Member

@Techatrix Techatrix commented Mar 1, 2024

report errors about zls.json

This change move the code that resolve and parses the zls.json from the main function into the initialize request.
This allows ZLS to report errors with messages like this:
Screenshot from 2024-03-01 19-40-06
Not perfect but still better than nothing. An improvement that could be added later would be reporting actual diagnostics instead of a message.

I had to remove the replay/record feature because it required the config to be resolved in main. I plan on bringing back this feature but I will probably be integrated differently.

make the Zig+ZLS compatibility check more strict

The compatibility check was previously only executed on the config resolve at startup/initialize. This check has moved to the updateConfiguration function which also includes updates that happen through in-editor configuration.

ZLS will also warn when the minimum Zig version is not met at runtime.
The only exception is when using Zig 0.11.* or 0.10.* (no development builds).

@Techatrix Techatrix changed the title Techatrix/config error reporting config error reporting Mar 1, 2024
@Techatrix Techatrix force-pushed the techatrix/config-error-reporting branch from 296db22 to d9dee69 Compare March 1, 2024 18:54
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 66.25000% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 78.65%. Comparing base (7e53a56) to head (a18d090).
Report is 2 commits behind head on master.

Files Patch % Lines
src/Server.zig 68.00% 24 Missing ⚠️
src/build_runner/BuildRunnerVersion.zig 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1808      +/-   ##
==========================================
+ Coverage   78.45%   78.65%   +0.19%     
==========================================
  Files          35       34       -1     
  Lines       10549    10539      -10     
==========================================
+ Hits         8276     8289      +13     
+ Misses       2273     2250      -23     

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

The compatibility check was previously only executed on the config
resolve at startup/initialize. This check has moved to the
updateConfiguration function which also includes updates that happen 
through in-editor configuration.

ZLS will also warn when the minimum Zig version is not met at runtime.
The only exception is when using Zig `0.11.*` or `0.10.*` (no development builds).
@Techatrix Techatrix merged commit f25fafe into master Mar 2, 2024
8 checks passed
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.

1 participant