Skip to content

feat(oxc_data_structure/rope): add get_offset_from_line_and_column#18133

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_
Feb 16, 2026
Merged

feat(oxc_data_structure/rope): add get_offset_from_line_and_column#18133
graphite-app[bot] merged 1 commit intomainfrom
01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Jan 17, 2026

This PR adds a new function get_offset_from_line_and_column that performs the inverse operation of the existing get_line_column function, converting UTF-16 line and column coordinates to a UTF-8 byte offset in source text.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Jan 17, 2026
Copy link
Member Author

Sysix commented Jan 17, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sysix Sysix force-pushed the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch from 000e80a to db880f8 Compare January 17, 2026 12:18
@Sysix Sysix requested a review from Copilot January 17, 2026 12:21
@Sysix Sysix force-pushed the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch from db880f8 to be3a3f6 Compare January 17, 2026 12:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new function get_offset_from_line_and_column that performs the inverse operation of the existing get_line_column function, converting UTF-16 line and column coordinates to a UTF-8 byte offset in source text.

Changes:

  • Added get_offset_from_line_and_column function to convert UTF-16 line/column to UTF-8 offset
  • Extended all existing test cases to verify the bidirectional conversion works correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix marked this pull request as ready for review January 17, 2026 12:23
@Sysix Sysix requested a review from overlookmotel as a code owner January 17, 2026 12:23
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 17, 2026

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ (b046e69) with main (5707e5c)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (a019f52) during the generation of this report, so 5707e5c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 29, 2026
Copy link
Contributor

camc314 commented Jan 29, 2026

Merge activity

  • Jan 29, 3:03 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 29, 3:03 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Jan 29, 3:12 PM UTC: camc314 removed this pull request from the Graphite merge queue.
  • Feb 16, 8:16 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 16, 8:16 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Feb 16, 8:24 PM UTC: Merged by the Graphite merge queue.

graphite-app bot pushed a commit that referenced this pull request Jan 29, 2026
…18133)

> This PR adds a new function get_offset_from_line_and_column that performs the inverse operation of the existing get_line_column function, converting UTF-16 line and column coordinates to a UTF-8 byte offset in source text.
@graphite-app graphite-app bot force-pushed the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch from be3a3f6 to 7d497fc Compare January 29, 2026 15:08
@camc314 camc314 marked this pull request as draft January 29, 2026 15:12
@camc314 camc314 removed the 0-merge Merge with Graphite Merge Queue label Jan 29, 2026
@camc314
Copy link
Contributor

camc314 commented Jan 29, 2026

Oops I meant to assign this to @overlookmotel to review, not merge it!

@camc314 camc314 marked this pull request as ready for review January 29, 2026 15:12
Sysix added a commit that referenced this pull request Feb 16, 2026
…18133)

> This PR adds a new function get_offset_from_line_and_column that performs the inverse operation of the existing get_line_column function, converting UTF-16 line and column coordinates to a UTF-8 byte offset in source text.
@Sysix Sysix force-pushed the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch from 7d497fc to b046e69 Compare February 16, 2026 18:41
@Sysix Sysix requested a review from overlookmotel February 16, 2026 18:50
Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Feb 16, 2026
…18133)

> This PR adds a new function get_offset_from_line_and_column that performs the inverse operation of the existing get_line_column function, converting UTF-16 line and column coordinates to a UTF-8 byte offset in source text.
@graphite-app graphite-app bot force-pushed the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch from b046e69 to e814049 Compare February 16, 2026 20:18
@graphite-app graphite-app bot merged commit e814049 into main Feb 16, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-17-feat_oxc_data_structure_rope_add_get_offset_from_line_and_column_ branch February 16, 2026 20:24
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 16, 2026
camc314 pushed a commit that referenced this pull request Feb 23, 2026
### 🚀 Features

- e814049 oxc_data_structure/rope: Add `get_offset_from_line_and_column`
(#18133) (Sysix)

### 🐛 Bug Fixes

- 7958b56 linter: Fix syntax error reporting in some output formatters.
(#19590) (connorshea)
- e316694 codegen: Avoid sourcemap panic on `U+2028`/`U+2029` (#19548)
(camc314)
- 933ff72 semantic: Emit correct error code for reserved type name
(#19545) (camc314)

### ⚡ Performance

- b5fa195 codegen: Remove bounds check from `SourcemapBuilder` (#19578)
(overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants