Skip to content

Adopt package access level #1573

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
Jul 21, 2024
Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 17, 2024

Change a l public declarations to the package access level, accept for:

  • The LanguageServerProtocol module
  • The BuildServerProtocol module
  • InProcessClient.InProcessSourceKitLSPClient
  • LanguageServerProtocolJSONRPC (I would like to create a more ergonomic API for this like InProcessSourceKitLSPClient in the future, but for now, we’ll leave it public)

Unfortunately, our pattern of marking functions as @_spi(Testing) public no longer works with the package access level because declarations at the package access level cannot be marked as SPI. I have decided to just mark these functions as package. Alternatives would be:

  • Add an underscore to these functions, like we did for functions exposed for testing before the introduction of SPI
  • Use @testable import in the test targets and mark the methods as internal

Resolves #1315
rdar://128295618

@ahoppen ahoppen requested a review from bnbarham July 17, 2024 22:24
@ahoppen
Copy link
Member Author

ahoppen commented Jul 17, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the package-access-level branch from 56b7bca to d0c158d Compare July 18, 2024 20:04
@ahoppen
Copy link
Member Author

ahoppen commented Jul 18, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Jul 18, 2024

@swift-ci Please test Windows

Change a l public declarations to the `package` access level, accept for:
- The `LanguageServerProtocol` module
- The `BuildServerProtocol` module
- `InProcessClient.InProcessSourceKitLSPClient`
- `LanguageServerProtocolJSONRPC` (I would like to create a more ergonomic API for this like `InProcessSourceKitLSPClient` in the future, but for now, we’ll leave it public)

Unfortunately, our pattern of marking functions as `@_spi(Testing) public` no longer works with the `package` access level because declarations at the `package` access level cannot be marked as SPI. I have decided to just mark these functions as `package`. Alternatives would be:
- Add an underscore to these functions, like we did for functions exposed for testing before the introduction of `SPI`
- Use `@testable` import in the test targets and mark the methods as `internal`

Resolves swiftlang#1315
rdar://128295618
@ahoppen ahoppen force-pushed the package-access-level branch from d0c158d to 2877675 Compare July 19, 2024 16:54
@ahoppen
Copy link
Member Author

ahoppen commented Jul 19, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Jul 20, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Jul 21, 2024

@swift-ci Please test macOS

@ahoppen
Copy link
Member Author

ahoppen commented Jul 21, 2024

@swift-ci Please test Linux

@ahoppen
Copy link
Member Author

ahoppen commented Jul 21, 2024

@swift-ci Please test macOS

@ahoppen ahoppen merged commit 8e3bb6b into swiftlang:main Jul 21, 2024
3 checks passed
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.

Adopt package access level
1 participant