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

improve formatting integration #222

Merged
merged 5 commits into from
Aug 21, 2024
Merged

improve formatting integration #222

merged 5 commits into from
Aug 21, 2024

Conversation

Techatrix
Copy link
Collaborator

@Techatrix Techatrix commented Jul 21, 2024

Over time, I've see users report issues with code formatting provided by this extension.
Unfortunately, I have not been able to reproduce any of these issues. They may just be caused by the fact that zig fmt is JIT compiled or something unrelated to that.

These changes should (hopefully) make code formatting more reliable by applying the following changes:

  • compile zig fmt when starting the extension
  • make the code formatting provider async and cancel-able

I also changed the default formatting provider from extension to zls. I've made sure that formatting can fallback to the extension provider if ZLS is not running. Perhaps this makes the formattingProvider unnecessary all together but I will leave that to another time.

@Techatrix Techatrix merged commit ebaa3d7 into master Aug 21, 2024
2 checks passed
@Techatrix Techatrix deleted the techatrix/formatting branch August 21, 2024 17:06
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