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

Register formatter #67

Merged
merged 3 commits into from
Mar 16, 2023
Merged

Register formatter #67

merged 3 commits into from
Mar 16, 2023

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Mar 10, 2023

Registers the Smithy formatter added in smithy-lang/smithy-language-server#89.

WIP until version 0.2.3 of the Smithy Language Server has been published.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@srchase srchase marked this pull request as ready for review March 15, 2023 21:36
@srchase srchase requested a review from a team as a code owner March 15, 2023 21:36
const range = edit.range;
const newText = edit.newText;

assert.equal(edits.length, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this going to be one edit per file, or is it smaller chunks than that? If the latter I'd be a bit worried about saying exactly one in case things change.

Copy link
Contributor Author

@srchase srchase Mar 16, 2023

Choose a reason for hiding this comment

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

test-fixtures/suite5/smithy/main.smithy should just need the one line indented, resulting in a single edit being returned from the Language Server. If there were multiple changes needed to format it properly, there could potentially be multiple edits returned.

I could loosen this test just to check that at least one edit is returned, and not assert anything further.

@srchase srchase merged commit f3a8f68 into smithy-lang:main Mar 16, 2023
@srchase srchase deleted the register-formatter branch March 16, 2023 15:48
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

Successfully merging this pull request may close these issues.

2 participants