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

Inline assistant outputs Elm code with shifted indentation under certain conditions #26326

Open
juanedi opened this issue Mar 8, 2025 · 0 comments

Comments

@juanedi
Copy link

juanedi commented Mar 8, 2025

Summary

Inline assistant outputs Elm code with shifted indentation under certain conditions

Steps to trigger the problem:

  1. Write a minimal Elm function that has no doc comment above its signature
  2. Select the body of the function
  3. Ask the inline assistant to make an edit

Actual Behavior: The generated code is offset to the right (making the module invalid Elm code!)

Expected Behavior: The generated code should preserve the original indentation

This also seems to happen if the function has a doc comment the selected range contains the comment. This doesn't seem to happen if the function has a doc comment but the selection does not include it. Attaching a recording below.

zed-elm-indentation-bug.mov

My settings.json is really minimal (I started using Zed very recently), and I don't suspect anything there might cause this. I am observing this with both Zed and OpenAI as AI providers. This also happens regardless of whether I am using elm-language-server or not, or where I have format_on_save enabled or not.

settings.json

Zed Version and System Specs

Zed: v0.176.3 (Zed)
OS: macOS 14.7.3
Memory: 32 GiB
Architecture: aarch64

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

No branches or pull requests

1 participant