Skip to content

Add a general notion of experimental features to sourcekit-lsp #1389

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

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 1, 2024

Background indexing probably won’t be the last experimental feature in sourcekit-lsp that we want to gate behind a feature flag. Instead of adding new parameters ad-hoc, introduce a general notion of experimental features.

Background indexing probably won’t be the last experimental feature in sourcekit-lsp that we want to gate behind a feature flag. Instead of adding new parameters ad-hoc, introduce a general notion of experimental features.
@ahoppen ahoppen requested review from bnbarham and hamishknight June 1, 2024 15:35
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 1, 2024 15:35
@ahoppen
Copy link
Member Author

ahoppen commented Jun 1, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 2258a6c into swiftlang:main Jun 2, 2024
3 checks passed
@ahoppen ahoppen deleted the experimental-features branch June 2, 2024 05:30
@gottesmm
Copy link

gottesmm commented Jun 2, 2024

@ahoppen I am pretty sure this broke the linux PR build: https://ci.swift.org/job/oss-swift-pr-test-ubuntu-20_04/

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +52 to +53
/// Experimental features that are enabled.
public var experimentalFeatures: [ExperimentalFeature]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to make a Set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption was that you usually pass less than 3 experimental features (honestly, most likely you pass 0) and I think a linear scan through an array is quicker than a set lookup in that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't really thinking of performance, more just semantically it feels like Set better fits. But I don't feel strongly at all 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither do I. It’s in as an array now, let’s just leave it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants