+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_formatter): Panic for out of order group id #3236

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

MichaReiser
Copy link
Contributor

@MichaReiser MichaReiser commented Sep 16, 2022

Summary

This PR fixes an issue where the printer panics if group ids aren't written to the document in the same order as they have been created because resize shrinks a vector if its size exceeds the argument.

Test Plan

I added a new printer test verifying that the printer no longer panics if group ids aren't added in the same order as they have been created with f.group_id.

@netlify
Copy link

netlify bot commented Sep 16, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit afddd1b
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/63242a73fa0184000a71e02c

@MichaReiser MichaReiser temporarily deployed to netlify-playground September 16, 2022 07:05 Inactive
@MichaReiser MichaReiser added the A-Formatter Area: formatter label Sep 16, 2022
@MichaReiser MichaReiser added this to the 0.10.0 milestone Sep 16, 2022
@github-actions
Copy link

github-actions bot commented Sep 16, 2022

Use `TextSize` instead of usize to represent text positions in the printer.

This PR also fixes an issue where the printer panics if group ids aren't written to the document in the same order as they have been created because `resize` shrinks a vector if its size exceeds the argument.
@MichaReiser MichaReiser force-pushed the perf/printer-text-size branch from fa49c78 to afddd1b Compare September 16, 2022 07:49
@MichaReiser MichaReiser temporarily deployed to netlify-playground September 16, 2022 07:49 Inactive
@MichaReiser MichaReiser changed the title perf(rome_formatter): Use TextSize in printer fix(rome_formatter): Panic for out of order group id Sep 16, 2022
@MichaReiser MichaReiser marked this pull request as ready for review September 16, 2022 07:50
@rome rome deleted a comment from github-actions bot Sep 16, 2022
@MichaReiser MichaReiser merged commit ca7d9b2 into main Sep 16, 2022
@MichaReiser MichaReiser deleted the perf/printer-text-size branch September 16, 2022 08:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载