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-13958] Sourcekit cursor info request with USR fails for initializers #56355

Open
keith opened this issue Dec 11, 2020 · 1 comment
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@keith
Copy link
Collaborator

keith commented Dec 11, 2020

Previous ID SR-13958
Radar rdar://problem/72302309
Original Reporter @keith
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 12829dceff23b892b48ac0f50490b8ff

Issue Description:

With this code:

struct Foo {
    init(a: String) {}
}

_ = Foo(a: "")

If you do a sourcekit index request like:

sourcekitd-test -req=index /tmp/init.swift -- /tmp/init.swift

You see the call to the initializer in the output:

    {
      key.kind: source.lang.swift.ref.function.constructor,
      key.name: "init(a:)",
      key.usr: "s:4init3FooV1aACSS_tcfc",
      key.line: 5,
      key.column: 5
    }

But when you try to get cursor info for the USR returned here, it fails:

% sourcekitd-test -req=cursor -usr s:4init3FooV1aACSS_tcfc /tmp/init.swift -- /tmp/init.swift
{
  key.request: source.request.configuration.global,
  key.optimize_for_ide: 1
}
{
  key.request: source.request.cursorinfo,
  key.usr: "s:4init3FooV1aACSS_tcfc",
  key.compilerargs: [
    "/tmp/init.swift"
  ],
  key.sourcefile: "/tmp/init.swift"
}
<empty cursor info; internal diagnostic: "Unable to resolve type from USR.">

This appears to be related to https://bugs.swift.org/browse/SR-13140

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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.
Projects
None yet
Development

No branches or pull requests

2 participants