Open adam-fowler opened 2 months ago
Synced to Apple’s issue tracker as rdar://128057021
Reduced to a sourcekitd test case. Moving to the apple/swift repo because that’s where sourcekitd lives.
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %swift-frontend -emit-module %t/Lib.swift -o %t/Modules/Lib.swiftmodule
// RUN: %swift-frontend -emit-module %t/Exporter.swift -o %t/Modules/Exporter.swiftmodule -I %t/Modules
// RUN: %swift-ide-test -code-completion -source-filename %t/Client.swift -I %t/Modules -code-completion-token COMPLETE | %FileCheck %s
//--- Lib.swift
public class MyClass {
public lazy var lazyValue: Bool = true
}
//--- Exporter.swift
@_exported import class Lib.MyClass
//--- Client.swift
import Lib
import Exporter
#^COMPLETE^#
// CHECK: Decl[Class]/OtherModule[Lib]: MyClass[#MyClass#]; name=MyClass
// CHECK-NOT: MyClass
Swift version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Platform
arm64-apple-macosx14.0
Editor
VSCode
Does the issue reproduce with Swift 6?
Yes
Description
If I export a symbol from a library to include it in the public symbols of another library then SourceKit-LSP considers these to be separate symbols and will duplicate them in completion lists
Steps to Reproduce
@_exported import class Foundation.JSONDecoder
JSON
into the file I get two completion entries forJSONDecoder
.Logging
No response