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-14736] Missing completion inside result builder with multiple binary operators #57086

Closed
ahoppen opened this issue Jun 8, 2021 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jun 8, 2021

Previous ID SR-14736
Radar rdar://problem/79092866
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, FoundByStressTester
Assignee None
Priority Medium

md5: db9ba955ac22ca34fd91e56e2769a90e

Issue Description:

The following test case fails to produce a completion for font. I haven’t been able to eliminate the dependency on SwiftUI unfortunately and the test case seems to be very sensitive to changes, removing one Text("a") causes the test to pass. Trying -debug-constraints, I get a debug output that’s >1GB.

./swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename test.swift  -sdk /Applications/Xcode-GPE.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -target arm64-apple-ios13.0
import SwiftUI

struct TodayTurnipSection {
    func foo() {
        HStack {
            Text("a")
            + Text("a").foregroundColor2(Color("ACSecondaryText"))
            + Text("a")
            + Text("a").foregroundColor2(Color("ACSecondaryText"))
        }
        .#^COMPLETE^#font(.system(.body, design: .rounded))
    }
}

extension Text {
  public func foregroundColor2(_ color: SwiftUI.Color?) -> SwiftUI.Text { fatalError() }
}

extension View {
  @inlinable public func foregroundColor2(_ color: SwiftUI.Color?) -> some SwiftUI.View {
        fatalError()
    } 
}
@typesanitizer
Copy link

@swift-ci create

@ahoppen
Copy link
Contributor Author

ahoppen commented Mar 24, 2022

Fixed by migrating more completions to solver-based implementation (most likely #41917 was the solution).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion found by stress tester Flag: An issue found by the SourceKit stress tester source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

3 participants