-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[SR-7828] Include name-based "fixits" whenever we do a unique name membership lookup #4803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Comment by Jhonny Bill Mena (JIRA) |
MaxDesiatov
pushed a commit
that referenced
this issue
Sep 18, 2023
… provided in the dependency (#6897) Update error message when there's a package target with a similar name as the one provided in the dependency. ### Motivation: Partially addresses #4803. It adds a suggestion for an alternative dependency name when there's a dependency target with similar name as the one provided in the `Package.swift`. ### Modifications: Use the existing `bestMatch(for, from)` from TSCBasic to compare the `productRef.name` and `allTargetNames`. However, I'm not sure how and if I can include target from system packages. ### Result: Error messages for package target not found may also suggest an alternative name like: `product 'Barx' required by package 'foo' target 'FooTarget' not found. Did you mean 'Bar'?`
This can now be closd. @MaxDesiatov Could you kindly close this please? |
IMO, the resolution is incomplete, as the PR in question only added warnings, while this issue requested actual fix-its that users can easily apply by clicking on them, like with any other fix-it. |
MaxDesiatov
pushed a commit
that referenced
this issue
Sep 28, 2023
… provided in the dependency (#6897) Update error message when there's a package target with a similar name as the one provided in the dependency. ### Motivation: Partially addresses #4803. It adds a suggestion for an alternative dependency name when there's a dependency target with similar name as the one provided in the `Package.swift`. ### Modifications: Use the existing `bestMatch(for, from)` from TSCBasic to compare the `productRef.name` and `allTargetNames`. However, I'm not sure how and if I can include target from system packages. ### Result: Error messages for package target not found may also suggest an alternative name like: `product 'Barx' required by package 'foo' target 'FooTarget' not found. Did you mean 'Bar'?`
MaxDesiatov
pushed a commit
that referenced
this issue
Sep 28, 2023
… provided in the dependency (#6897) Update error message when there's a package target with a similar name as the one provided in the dependency. ### Motivation: Partially addresses #4803. It adds a suggestion for an alternative dependency name when there's a dependency target with similar name as the one provided in the `Package.swift`. ### Modifications: Use the existing `bestMatch(for, from)` from TSCBasic to compare the `productRef.name` and `allTargetNames`. However, I'm not sure how and if I can include target from system packages. ### Result: Error messages for package target not found may also suggest an alternative name like: `product 'Barx' required by package 'foo' target 'FooTarget' not found. Did you mean 'Bar'?`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional Detail from JIRA
md5: 09bf5631fee7a0af06fa651808d31d64
Issue Description:
This diagnostic is not very good, SwiftPM should suggest the right spelling by comparing against the products which are available and suggesting a likely match if the string edit distance is small enough, similar to what the compiler does.
The edit distance algorithm as landed in SwiftPM with #1431
The text was updated successfully, but these errors were encountered: