Skip to content
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

[SR-7828] Include name-based "fixits" whenever we do a unique name membership lookup #4803

Open
ankitspd opened this issue May 31, 2018 · 3 comments
Labels
bug good first issue Good for newcomers Edit

Comments

@ankitspd
Copy link
Member

Previous ID SR-7828
Radar rdar://problem/34911728
Original Reporter @aciidb0mb3r
Type Bug
Status Reopened
Resolution
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, StarterBug
Assignee None
Priority Medium

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.

$ swift build
error: product dependency 'FooBar' not found

The edit distance algorithm as landed in SwiftPM with #1431

@swift-ci
Copy link
Contributor

Comment by Jhonny Bill Mena (JIRA)

#1747

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@tomerd tomerd added good first issue Good for newcomers Edit and removed Package Manager labels May 14, 2022
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'?`
@mininny
Copy link
Contributor

mininny commented Sep 19, 2023

This can now be closd. @MaxDesiatov Could you kindly close this please?

@MaxDesiatov
Copy link
Member

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
Labels
bug good first issue Good for newcomers Edit
Projects
None yet
Development

No branches or pull requests

5 participants