-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refine error message with package name suggestion #6897
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
Refine error message with package name suggestion #6897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a true fix-it? I.e. is it displayed as an actionable fix-it that users can easily apply when parsed by Xcode or SourceKit-LSP?
No, this is not a true fix-it that users can interact on(e.g. click to replace text). It's just a text inside warning that gives a clue about detecting typos. |
e6d992c
to
efd8395
Compare
… provided in the dependency
efd8395
to
ab88fd3
Compare
@swift-ci test |
… 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'?`
… 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'?`
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 theproductRef.name
andallTargetNames
.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'?