Probably not significant in practice but I noticed that we don’t need to compute the prefix of `orLog` unless the closure threw an error. Make `prefix` an autoclosure to avoid its eager computation.
This adds a sourcekitd plugin that drives the code completion requests. It also includes a `CompletionScoring` module that’s used to rank code completion results based on their contextual match, allowing us to show more relevant code completion results at the top.
`URL.path` returns forward slashes in the path on Windows (https://github.com/swiftlang/swift-foundation/issues/973) where we expect backslashes. Work around that by defining our own `filePath` property that is backed by `withUnsafeFileSystemRepresentation`, which produces backslashes.
rdar://137963660
For some reason, logging to `stderr` makes test execution hang on Windows when running tests in parallel – it appears that stdout and stderr are handled the same way but there must be some difference, I wasn’t able to reduce the issue.
When running the sourcekit-lsp binary, stdout gets redirected to stderr, so logging printing to stdout ends up with the same result as `fputs` to `stderr`.
Even if we don’t want to log any sensitive information, we can still log the keys of JSON objects and insensitive values such as integers and booleans.
Xcode 16 with Swift 6 has been released, we can drop support for building and testing SourceKit-LSP using a Swift 5.10 toolchain. This allows us to remove a number of workarounds.
Also adjust the log privacy level on non-Apple platforms to `public` and don’t log potentially sensitive information by default.
rdar://132525691
Resolves#1591