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
Formatting Smithy document #89
Conversation
src/main/java/software/amazon/smithy/lsp/editor/SmartInput.java
Outdated
Show resolved
Hide resolved
I got a chance to wire this into the Smithy for VS Code extension, and it's great! Is it possible to tweak to the underlying formatter? I noticed that trailing commas are added when 3 or more mixins are split into separate lines: This:
Gets reformatted to this:
Could those trailing commas get dropped? For comparison, when errors on an operation are broken into separate lines, trailing commas are not added there. |
If this gets merged, I'd like to take some time to work on a configuration that could be used to tweak the formatter version, and, maybe, specify the version so we don't have to update the language server everytime the formatter gets an update. |
Making this configurable makes sense. I'll merge this now, and will bump the formatter after disneystreaming/smithy-translate#102 is merged before we cut a release of the language server. |
Thanks, @srchase this is amazing |
Recently, we made great progress on our Smithy parser. We were able to build a formatter to go along with it. This PR adds formatting capability to the language server implementation. Formatting happens when the client requests it. For example in VS Code:
Here is a small demo:
smithy-formatter-vscode.mov