Skip to content

Conversation

mcy
Copy link
Member

@mcy mcy commented Sep 24, 2025

This PR adds two related features:

  1. An unused imports warning, which requires additional book-keeping to track which direct import caused a transitive import to get imported.
  2. Codegen for the Buf source code info extension, which includes unused imports and whether a syntax production exists in the file.

In the process of implementing this, I found a bug in how imports are built, which this PR fixes. It showed up because import causes weren't being listed correctly, leading to incorrect diagnosis of unused imports. I also fixed a bug in yaml.go where extensions we're being printed in the output.

@mcy mcy requested a review from emcfarlane September 24, 2025 22:06
@mcy
Copy link
Member Author

mcy commented Sep 24, 2025

There is one broken test due to a bug in how editions are lowered. See #567

@mcy mcy enabled auto-merge (squash) September 26, 2025 23:08
@mcy mcy merged commit 4ad7544 into main Sep 26, 2025
6 checks passed
@mcy mcy deleted the mcy/unused-imports branch September 26, 2025 23:11
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