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

No way to discover a trait's Compilation Condition #2059

Open
1 task done
davedelong opened this issue Mar 10, 2025 · 3 comments
Open
1 task done

No way to discover a trait's Compilation Condition #2059

davedelong opened this issue Mar 10, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@davedelong
Copy link

davedelong commented Mar 10, 2025

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

SwiftPM does not appear to provide any sort of in-editor information to a package developer about how to use traits defined in Package.swift. There's no indication informational message, no template comments, no autocomplete help, etc for what this .trait(...) thing does nor how one is supposed to use it. There is no autocomplete for #if ...

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

Swift Package Manager - Swift 6.0.3

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.9 clang-1600.0.30.1)

Darwin Localhost 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 arm64

@davedelong davedelong added the bug Something isn't working label Mar 10, 2025
@MaxDesiatov MaxDesiatov transferred this issue from swiftlang/swift-package-manager Mar 12, 2025
@ahoppen
Copy link
Member

ahoppen commented Mar 12, 2025

Synced to Apple’s issue tracker as rdar://146864867

@ahoppen
Copy link
Member

ahoppen commented Mar 18, 2025

Just to make sure I understand you correctly: Are you suggesting that code completion should offer the available trait names when completing inside #if?

@davedelong
Copy link
Author

Essentially, yes. If I type #if and then hit escape, I should be getting a list of possible things that can go after an #if token, which includes trait names. I should not be getting the current (as of Xcode 16.2) behavior of "No Completions".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants