- Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
SourceKitArea → source tooling: SourceKitArea → source tooling: SourceKitbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.cursor infoArea → source tooling: cursor infoArea → source tooling: cursor infosource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingswift 6.0unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Description
As reported in Jump-to-definition to init of a C struct does not work, sourcekitd will return an incorrect value of key.modulename for a non-existent constructor of a C struct. This incorrect module name prevents the subsequent navigation to the designated generated interface.
Reproduction
import Darwin func test() { _ = timespec(tv_sec: 0, tv_nsec: 0) }The cursor info (truncated) of the initializer of timespec returned by sourcekitd is as follows,
key.kind: source.lang.swift.ref.function.constructor, key.name: "init(tv_sec:tv_nsec:)", key.usr: "s:So8timespecV6tv_sec0B5_nsecABSi_Sitcfc", key.typename: "(timespec.Type) -> (Int, Int) -> timespec", key.modulename: "Darwin", ... key.is_system: true, ... key.decl_lang: source.lang.swift, Expected behavior
The expected value of key.modulename should be "Darwin.POSIX.sys.types._timespec" Instead of "Darwin".
Environment
swiftlang-6.0.0.6.8 clang-1600.0.23.1
Additional information
No response
Metadata
Metadata
Assignees
Labels
SourceKitArea → source tooling: SourceKitArea → source tooling: SourceKitbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.cursor infoArea → source tooling: cursor infoArea → source tooling: cursor infosource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingswift 6.0unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output