Skip to content

Add support for Odin's formatter - #9537

Merged
archseer merged 1 commit into
helix-editor:masterfrom
Chickenkeeper:odin-formatter
Feb 12, 2024
Merged

Add support for Odin's formatter#9537
archseer merged 1 commit into
helix-editor:masterfrom
Chickenkeeper:odin-formatter

Conversation

@Chickenkeeper

Copy link
Copy Markdown
Contributor

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

@the-mikedavis the-mikedavis left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

the-mikedavis commented Feb 6, 2024

Copy link
Copy Markdown
Member

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
@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