zed
zed copied to clipboard
Kotlin curly braces do not auto-close
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I have in my settings
"Kotlin": {
"auto_close": true
}
but still whenever I type in a .kt file fun main() { and press enter, it does not automatically insert a closing }. It does however do this with parentheses.
Environment
Zed: v0.125.3 (Zed) OS: macOS 14.2.1 Memory: 8 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
No response
That's a bug in Kotlin extension then; basically, we need to add more brackets into this array in config.toml.
That's a bug in Kotlin extension then; basically, we need to add more brackets into this array in config.toml.
That looks pretty simple. Should I submit a pull request for the addition to that file?
Yeah, the change itself is simple, though that repository seems to be unmaintained per this comment. I've pinged folks from my team to see what we can do about it.
So the pull request was merged into the kotlin extension https://github.com/zed-extensions/zed-kotlin/pull/2 but it doesn't look like that has made it into Zed itself yet. Just ran brew upgrade zed and tried it out, still no auto-close behavior (and the Kotlin extension says v0.0.1) What is the process for getting the newest version of an extension into Zed?
edit: found the instructions. Trying to test the updated extension locally before submitting a PR for it in /extensions. If anyone could help me figure that out getting local testing working properly at a discussion I made https://github.com/zed-industries/zed/discussions/10834
Oh, right, we need to cut a new release of Kotlin extension. I'll do that in a sec
Auto-closing is working now, but the newline + automatic indentation behavior is not quite right yet. https://github.com/zed-extensions/zed-kotlin/pull/2#issuecomment-2069905683
While more work needs to be done to get newline + automatic indentation, this particular issue was solved with commit https://github.com/zed-extensions/zed-kotlin/commit/e175918c3de463040b025fa7059a33993bd0fdcf.
Opened dedicated issue https://github.com/zed-extensions/zed-kotlin/issues/5 for newline + automatic indentation