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 refactoring now takes a `Syntax` parameter. We don't actually
need to change anything else to handle placeholder expansion for
macro expansion completions since they get parsed as function calls.
User-installed package headers are installed to `/usr/local/include` on
FreeBSD. The build system should tell the compiler where the additional
headers are located.
Adopt the option introduced by https://github.com/swiftlang/swift/pull/81507. SourceKit-LSP uses explicit cancellation and perform any implicit cancellation inside sourcekitd.
Fixes#2021
rdar://145871554
Previously Package.swift referred a non-existent CMakeLists.txt file
and used old URLs for the swift-tools-support-core repository, leading
to the following build warnings:
warning: 'sourcekit-lsp': Invalid Exclude '/Users/wilfred/src/sourcekit-lsp/Sources/DocCDocumentation/CMakeLists.txt': File not found.
warning: 'swift-package-manager': 'swift-package-manager' dependency on 'https://github.com/swiftlang/swift-tools-support-core.git' conflicts with dependency on 'https://github.com/apple/swift-tools-support-core.git' which has the same identity 'swift-tools-support-core'. this will be escalated to an error in future versions of SwiftPM.
warning: 'swift-driver': 'swift-driver' dependency on 'https://github.com/swiftlang/swift-tools-support-core.git' conflicts with dependency on 'https://github.com/apple/swift-tools-support-core.git' which has the same identity 'swift-tools-support-core'. this will be escalated to an error in future versions of SwiftPM.
This is what `shutDown()` is documented to do. I also remember having this check before, it might have gotten lost during a rebase when I was working on https://github.com/swiftlang/sourcekit-lsp/pull/2081.
I noticed this while investigating https://github.com/swiftlang/sourcekit-lsp/pull/2152: In this case `buildTarget/prepare` was cancelled because the SourceKit-LSP server was shut down but indexing of a file was still started after the shutdown now that preparation had finished (because it was cancelled).
A queued task might have been cancelled after the execution ask was started but before the task was yielded to `executionTaskCreatedContinuation`. In that case the result task will simply cancel the await on the `executionTaskCreatedStream` and hence not call `valuePropagatingCancellation` on the execution task. This means that the queued task cancellation wouldn't be propagated to the execution task. To address this, check if `resultTaskCancelled` was set and, if so, explicitly cancel the execution task here.
Fixes an issue I saw in CI during PR testing.
Similar to how we send a `workspace/diagnostic/refresh` request to the client when we get new build settings, we need to send a `workspace/semanticTokens/refresh` to the client to reload semantic tokens when builds settings change. This is particularly important so that we reload semantic tokens from real build setting after a SwiftPM package has finished loading (we previously used fallback settings).
Fixes#2141
rdar://150934682
When the compiler in `compile_commands.json` references a `swift` executable that’s a symlink to `swiftly`, SourceKit-LSP got confused because the `swift` executable doesn’t reside in a real toolchain, causing us to not provide any semantic functionality.
When we discover that the `swift` executable reference in compile commands references a `swiftly` executable, use `swiftly use -p` to resolve the binary in the real toolchain and continue operating based on that.
Fixes#2128
rdar://150301344
The SwiftPM smoke test still fails to build. I see the SwiftASN1
modules aren't getting added to the include path. Hopefully an
explicit dependency will fix that.
This should be a last stop-gap measure in case sourcekitd or clangd get stuck, don’t respond to any requests anymore and don’t honor cancellation either. In that case we can restore SourceKit-LSP behavior by killing them and using the crash recovery logic to restore functionality.
rdar://149492159
SwiftPM has added Crypto related functionality to Workspace to
support signing of the swift-syntax prebuilts manifest signing.
This breaks sourcekit-lsp builds on Windows complaining about
SwiftASN1 being missing. Adding a clause here to match the one
in SwiftPM's CMakeLists.txt file.