22 Commits

Author SHA1 Message Date
Anthony Latsis
6b19657739 Enable ExistentialAny 2025-12-02 12:27:27 +00:00
Alex Hoppen
98cd30bb1c Apply exhaustive swift-format configuration from swift-syntax
Apply the exhaustive swift-format configuration from https://github.com/swiftlang/swift-syntax/pull/3117 to sourcekit-lsp. Also apply all automatic formattings.
2025-08-11 09:23:39 +02:00
Alex Hoppen
92aa94fa43 Remove the split between SourceKitD and DynamicallyLoadedSourceKitD
There is only one real class that implements the `SourceKitD` protocol, so there really isn’t any need for the protocol + class split at all. Unify them to make code simpler to reason about.
2025-03-27 11:05:24 -07:00
Alex Hoppen
1cfa8db1d8 Require Swift 6 to build SourceKit-LSP
This significantly cleans up our `import` statements
2025-03-07 08:05:49 -08:00
Alex Hoppen
8cd831b55d Adopt InternalImportsByDefault 2024-09-27 09:17:13 -07:00
Alex Hoppen
8e3bb6bd2f Merge pull request #1573 from ahoppen/package-access-level 2024-07-20 21:55:38 -07:00
Alex Hoppen
2877675bd5 Adopt package access level
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
2024-07-19 09:54:30 -07:00
Alex Hoppen
edf19dbbd8 Import Darwin in files that use free
rdar://131965190
2024-07-18 11:30:23 -07:00
Finagolfin
1cf6c76897 Import new Bionic module from Android overlay instead where possible 2024-07-08 19:08:07 +05:30
Finagolfin
7c20015331 Import new Android overlay 2024-07-04 02:20:23 +05:30
Alex Hoppen
f1b34b1c9b Make SKD{Request,Response}{Dictionary,Array} Sendable 2024-03-20 11:48:50 +01:00
Alex Hoppen
f5fb23ad4c Rename sourcekitd_ to sourcekitd_api_ and add nullability annotations to sourcekit_functions.h
Naming types in sourcekitd_functions.h `sourcekit_api_` instead of `sourcekitd_` indicates that these are types to be used with dynamically loaded sourcekitd libraries. It avoids confusion if sourcekitd is also linked, which adds the `sourcekitd_` symbols.

Adding nullability annotations to it is also just nice.

And some improved formatting never hurts.
2024-02-23 09:13:42 -08:00
Alex Hoppen
6f98029ff7 Rename SKDValue to SKDRequestValue
`SKDValue` is only used for requests and the name should reflect that.
2024-02-15 21:30:29 -08:00
Alex Hoppen
3991fae867 Define methods on SourceKitD to create arrays and dictionaries instead of using skd postfix syntax 2024-01-08 18:06:31 -08:00
Alex Hoppen
f901cc9250 Support creation of SKDRequest(Dictionary|Array) from literals
IMO this makes it a lot clearer which keys are present in the request dictionaries because we are no longer mutating them on the fly.
2023-12-22 22:29:11 -08:00
Alex Hoppen
34a36b44e6 Refactor rename to support index-based discovery of rename locations 2023-12-12 17:34:34 -08:00
Alex Hoppen
777f1dc463 Add support for rename within the current file
rdar://117822427
2023-12-09 08:35:13 -08:00
Alex Hoppen
d0fc00ce98 Format using swift-format
Add `.swift-format` to the repo and format the repo with `swift-format`.

This commit does not add any automation to enforce formatting of sourcekit-lsp in CI. The goal of this commit is to get the majority of source changes out of the way so that the diff of actually enforcing formatting will have fewer changes or conflicts.
2023-10-10 13:44:47 -07:00
Max Desiatov
66f1c0dbf2 Add support for Musl libc with canImport(Musl) checks (#772)
Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html), it requires a different import, which now should be applied to files that have `import Glibc` in them.

Musl is a low footprint libc that's used in Linux distributions such as Alpine Linux, which allows producing fairly small container images. Additionally, unlike Glibc, musl allows full static linking, meaning apps can be easily distributed to an arbitrary Linux distribution that may have a version of Glibc incompatible with the one that Swift is usually built with or no Glibc installed at all.
2023-07-18 22:51:26 +01:00
YR Chen
031a0913e0 Import CRT to resolve free on Windows 2022-03-14 05:18:28 +08:00
Marcel Hlopko
3f506c5725 Import glibc 2020-12-15 17:24:37 +01:00
Ben Langmuir
f9d26d6bcf [sourcekitd] Move SourceKitD to its own module and lightly refactor 2020-06-03 14:51:03 -07:00