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

feat: add basic comment context formatting #2697

Merged
merged 3 commits into from
Sep 2, 2022

Conversation

kayagokalp
Copy link
Member

closes #2696.
closes #2691.

@kayagokalp kayagokalp added bug Something isn't working enhancement New feature or request formatter labels Sep 2, 2022
@kayagokalp kayagokalp self-assigned this Sep 2, 2022
@kayagokalp kayagokalp requested a review from a team September 2, 2022 06:08
@kayagokalp kayagokalp marked this pull request as ready for review September 2, 2022 06:08
@kayagokalp kayagokalp marked this pull request as draft September 2, 2022 06:09
@kayagokalp kayagokalp removed the request for review from a team September 2, 2022 06:09
@kayagokalp kayagokalp changed the base branch from master to eureka-cpu/1516 September 2, 2022 06:11
sway-fmt-v2/src/utils/map/comments.rs Outdated Show resolved Hide resolved
sway-fmt-v2/src/utils/map/comments.rs Outdated Show resolved Hide resolved
sway-fmt-v2/src/utils/map/comments.rs Outdated Show resolved Hide resolved
@kayagokalp kayagokalp changed the base branch from eureka-cpu/1516 to master September 2, 2022 06:22
Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>
@kayagokalp kayagokalp marked this pull request as ready for review September 2, 2022 06:23
@kayagokalp kayagokalp requested review from mitchmindtree and a team September 2, 2022 06:23
@kayagokalp kayagokalp enabled auto-merge (squash) September 2, 2022 06:23
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

Nice work on tracking this down 👍 I think these patches are definitely starting to get a little hacky, but we can do some cleanup in formatter once we've at least got all tests passing and have landed #2669.

@kayagokalp kayagokalp requested a review from a team September 2, 2022 06:32
Copy link
Contributor

@eightfilms eightfilms left a comment

Choose a reason for hiding this comment

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

utACK

@kayagokalp kayagokalp merged commit 7ee3256 into master Sep 2, 2022
@kayagokalp kayagokalp deleted the kayagokalp/basic_comment_context_formating branch September 2, 2022 06:54
mitchmindtree added a commit that referenced this pull request Sep 2, 2022
…formatting fixes (#2698)

* refactor: forc-deploy requires wallet address and accepts signature (#2629)

* Add the `CopyTypes` trait to `DeclarationId` (#2682)

Co-authored-by: Toby Hutton <toby@grusly.com>

* fix: Unformatted comment spans add extra newline (#2692)

* newline handler checks for existing newlines before inserting new ones

* stability test added

* newline-comment handler interaction test added

* review suggestion

* feat: add basic comment context formatting (#2697)

* feat: add comment context formatting

* test: enhance newline-comment handler interaction test

* Apply suggestions from code review

Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>

Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>

* Update `examples/` for recent swayfmt-v2 patches

Co-authored-by: Kaya Gökalp <kayagokalp@sabanciuniv.edu>
Co-authored-by: Emily Herbert <17410721+emilyaherbert@users.noreply.github.com>
Co-authored-by: Toby Hutton <toby@grusly.com>
eureka-cpu added a commit that referenced this pull request Sep 2, 2022
* update plugin and swayfmt toml, remove old formatter

* update config to formatter for consistency

* wip fix lsp formatting

* more merge conflicts

* update dependencies to 22.1

* remove files that made it back in from merge

* comment out function in LSP that uses formatter

* format examples and remove debug printlns

* Merge #2669 (swayfmt replacement PR) with `master` including newline formatting fixes (#2698)

* refactor: forc-deploy requires wallet address and accepts signature (#2629)

* Add the `CopyTypes` trait to `DeclarationId` (#2682)

Co-authored-by: Toby Hutton <toby@grusly.com>

* fix: Unformatted comment spans add extra newline (#2692)

* newline handler checks for existing newlines before inserting new ones

* stability test added

* newline-comment handler interaction test added

* review suggestion

* feat: add basic comment context formatting (#2697)

* feat: add comment context formatting

* test: enhance newline-comment handler interaction test

* Apply suggestions from code review

Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>

Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>

* Update `examples/` for recent swayfmt-v2 patches

Co-authored-by: Kaya Gökalp <kayagokalp@sabanciuniv.edu>
Co-authored-by: Emily Herbert <17410721+emilyaherbert@users.noreply.github.com>
Co-authored-by: Toby Hutton <toby@grusly.com>

* change name to swayfmt, kashira

* add swayfmt file

* sort toml dependencies

* fix excess newlines in format_context

* test on examples

Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>
Co-authored-by: Kaya Gökalp <kayagokalp@sabanciuniv.edu>
Co-authored-by: Emily Herbert <17410721+emilyaherbert@users.noreply.github.com>
Co-authored-by: Toby Hutton <toby@grusly.com>
Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add comment context formatting to sway-fmt-v2 Unformatted comment spans add extra newline
3 participants