Skip to content

fix: resolve grouped imports correctly#213

Merged
calebdw merged 1 commit into
mainfrom
calebdw/push-ztvqmupluwqk
Jul 9, 2026
Merged

fix: resolve grouped imports correctly#213
calebdw merged 1 commit into
mainfrom
calebdw/push-ztvqmupluwqk

Conversation

@calebdw

@calebdw calebdw commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Grouped use imports had two separate issues.

First, unknown-class diagnostics skipped only single-line import declarations. When a grouped use statement was split across multiple lines, the imported names on continuation lines were treated as ordinary class references and incorrectly flagged as missing.

Second, go-to-definition on a class name inside a grouped use declaration could fail because symbol extraction recorded the grouped item without its namespace prefix, so the declaration-site reference did not carry the correct fully-qualified name.

Track pending multiline use declarations until their terminating semicolon, and record grouped use items with their full namespace prefix. Add regression coverage for parser/resolved-name handling, unknown-class diagnostics, and go-to-definition on both grouped import usage sites and grouped use declarations.

Relates to #128

Grouped use imports had two separate issues.

First, unknown-class diagnostics skipped only single-line import
declarations. When a grouped use statement was split across multiple
lines, the imported names on continuation lines were treated as ordinary
class references and incorrectly flagged as missing.

Second, go-to-definition on a class name inside a grouped use
declaration could fail because symbol extraction recorded the grouped
item without its namespace prefix, so the declaration-site reference did
not carry the correct fully-qualified name.

Track pending multiline use declarations until their terminating
semicolon, and record grouped use items with their full namespace
prefix. Add regression coverage for parser/resolved-name handling,
unknown-class diagnostics, and go-to-definition on both grouped import
usage sites and grouped use declarations.

Relates to #128
@calebdw calebdw force-pushed the calebdw/push-ztvqmupluwqk branch from 80d0342 to efeaafb Compare July 9, 2026 18:08
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.68085% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/symbol_map/extraction.rs 75.00% 3 Missing ⚠️
src/diagnostics/unknown_classes.rs 92.59% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@calebdw calebdw merged commit 91f2f35 into main Jul 9, 2026
6 of 7 checks passed
@calebdw calebdw deleted the calebdw/push-ztvqmupluwqk branch July 9, 2026 18:20
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