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-14711] Missing completion inside result builder #57061

Closed
ahoppen opened this issue Jun 2, 2021 · 1 comment
Closed

[SR-14711] Missing completion inside result builder #57061

ahoppen opened this issue Jun 2, 2021 · 1 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

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jun 2, 2021

Previous ID SR-14711
Radar rdar://78781728
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: 121bdf01ae8f8e71f655ac481e31ecb3

Issue Description:

In the following test case font is not being suggested.

// RUN: %swift-ide-test --code-completion --source-filename %s --code-completion-token=COMPLETE

struct TodaySectionEditView {
    var sections: [SectionHeaderView2] = []
    @ViewBuilder2 var body: some View2 {
        ForEach2(sections, id: \.text) { section in
            Text2("")
            Text2(section.text)
                .#^COMPLETE^#font()
        }
    }
}

protocol View2 {}

extension View2 {
  func font() -> some View2 { fatalError() }
}

@resultBuilder public struct ViewBuilder2 {
  static func buildBlock() -> Never { fatalError() }
  static func buildBlock<Content>(_ content: Content) -> Content where Content : View2 { fatalError() }
  static func buildBlock<C0, C1>(_ c0: C0, _ c1: C1) -> C0 where C0 : View2, C1 : View2 { fatalError() }
}

struct Text2: View2 {
  init(_ s: String) {}
}

struct SectionHeaderView2 {
    let text: String = ""
}

public struct ForEach2<Data, ID, Content>: View2 where Data : RandomAccessCollection {
  init(_ data: Data, id: KeyPath<Data.Element, ID>, @ViewBuilder2 content: @escaping (Data.Element) -> Content) {}
}
@ahoppen
Copy link
Contributor Author

ahoppen commented Jul 29, 2021

The issue appears to have been fixed on main. Added the test case here: #38367

@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

2 participants