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

Add support for Odin's formatter #9537

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

Chickenkeeper
Copy link
Contributor

Odin's language server also comes with a formatter, so it would be nice to make use of it.

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Does the language server support auto-formatting? If so then let's just enable auto-format rather than adding an external formatter config

@Chickenkeeper
Copy link
Contributor Author

The language server does support auto-formatting, however odinfmt is also provided as a seperate executable, so I added the external formatter config so people could use the odinfmt on its own if they don't want to use the full language server

@the-mikedavis
Copy link
Member

the-mikedavis commented Feb 6, 2024

If you have an external formatter and the language server installed, we currently prefer the formatter even though it's likely less efficient than the language server computing and sending the edits (since we need to shell out and then generate the edits between the old and new text).

I think this comes up with other languages though (Zig IIRC) so I'll make a separate issue and let's merge this as-is 👍

(#9543)

@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Feb 6, 2024
@archseer archseer merged commit 661e123 into helix-editor:master Feb 12, 2024
6 checks passed
@Chickenkeeper Chickenkeeper deleted the odin-formatter branch February 12, 2024 17:49
cosmikwolf pushed a commit to cosmikwolf/helix that referenced this pull request Feb 26, 2024
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants