Skip to content

Conversation

@patreon-steve
Copy link
Contributor

Summary

Fixes issue 1322 where PositionProvider does not provide positions for whitespace. The issue seems to be that when there is no pattern for whitespace nodes during codegen, then they are not included in the position metadata.

Test Plan

  • Added a test
  • Verified this test failed
  • Implemented fix and verified fix

@facebook-github-bot
Copy link

Hi @patreon-steve!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 1, 2025
@drinkmorewaterr
Copy link
Contributor

Hi @patreon-steve,
Thanks for the PR :) In general it lgtm !

However there are a few failing tests, it seems like the python parser doesn't support match statements.
Luckily for us its marked for removal anyways... give me a couple days to see if we can either

  1. Remove the old python parser completely
  2. Add a way to mark tests as 'native-only'

@patreon-steve
Copy link
Contributor Author

Hi @patreon-steve, Thanks for the PR :) In general it lgtm !

However there are a few failing tests, it seems like the python parser doesn't support match statements. Luckily for us its marked for removal anyways... give me a couple days to see if we can either

  1. Remove the old python parser completely
  2. Add a way to mark tests as 'native-only'

Awesome. Thank you

@imsut
Copy link
Contributor

imsut commented Jul 30, 2025

Hi @drinkmorewaterr. I wonder if there is any updates here. I'd like to use "match" statements and make libCST work with it. Thank you!

@drinkmorewaterr
Copy link
Contributor

Hi @patreon-steve,
Sorry for the delay, can you try rebasing this PR on master :)

@imsut
Copy link
Contributor

imsut commented Aug 4, 2025

I'm taking over this fix from @patreon-steve. The new PR here #1389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PositionProvider does not provide position for match statements

4 participants