Skip to content

[SR-14801] Completion in argument label position shows invalid non-argument-label completions (in result builder) #57149

@ahoppen

Description

@ahoppen
Previous ID SR-14801
Radar rdar://79555026
Original Reporter @ahoppen
Type Bug
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug
Assignee None
Priority Medium

md5: a775b8df2dedca081346ae7d15c9a1d0

Issue Description:

In the following test case when completing foo, bspectRatio gets added a second time after the (.

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

protocol View2 {}

extension Never: View2 {}

@resultBuilder struct ViewBuilder2 {
  static func buildBlock() -> Never { fatalError() }
  static func buildBlock<Content>(_ content: Content) -> Content where Content : View2 { fatalError() }
}

struct AsyncImage2<Content> : View2 where Content : View2 {
  init(@ViewBuilder2 content: @escaping (Image2) -> Content) { fatalError() }
}

struct Image2: View2 {}

extension View2 {
  func bspectRatio(foo: Int) -> Never { fatalError() }
}

struct ContentView: View2 {
  var body: some View2 {
    AsyncImage2() { image in
      image.bspectRatio(#^COMPLETE^#foo: 1)
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completionsource toolingArea: IDE support, SourceKit, and other source tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions