13 Commits

Author SHA1 Message Date
Anthony Latsis
6b19657739 Enable ExistentialAny 2025-12-02 12:27:27 +00:00
Owen Voorhees
f04b971726 Adopt swift-tools-protocols 2025-10-31 14:11:11 -07: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
8c34a76f59 Rename LSPLogging to SKLogging 2024-07-25 09:11:13 -07:00
Alex Hoppen
8642768902 Fix a few Swift concurrency warnings 2024-06-18 18:07:22 -07:00
Alex Hoppen
59ef3f657b Make the Diagnose module build in Swift 6 mode
This was mostly about slapping `@MainActor` on a bunch of declarations since `diagnose` doesn’t leverage concurrency at the moment.
2024-05-13 21:43:20 -07:00
Alex Hoppen
447cc9e5bc Teach sourcekit-lsp diagnose how to reduce swift-frontend crashes
`sourcekit-lsp diagnose` tries to automatically scrape crash reports on the user’s machine for compiler arguments. If it finds any, it tries to reduce that swift-frontend crash.

Alternatively, a swift-frontend crash can be reduced by running `sourcekit-lsp reduce-frontend [--toolchain /path/to/toolchain] --frontend-args -all -the frontend --args`
2024-03-20 10:03:11 +01:00
Alex Hoppen
bf31f4a6b3 Sink handling of file writing into the SourceKitRequestExecutor
It’s cleaner plus it opens the option to reduce compiler crashes in the future.
2024-03-20 10:01:50 +01:00
Alex Hoppen
96ab4a7776 Add a progress bar to the diagnose subcommand 2024-03-01 15:52:08 -08:00
Alex Hoppen
27db4612f2 Delete temporary files created during sourcekitd reduction 2024-02-02 15:46:13 -08:00
Alex Hoppen
43881fc2f6 Address typo-kind review comments from #1037 2024-02-02 15:34:47 -08:00
Alex Hoppen
9415d03bf8 Allow reduction of non-crashers using the diagnose subcommand and inline import statements 2024-01-29 23:08:03 -08:00
Alex Hoppen
194cde22db Add a subcommand to sourcekit-lsp that automatically reduces sourcekitd crashes
Essentially, this is adding three pieces of functionality:
1. `sourcekit-lsp run-sourcekitd-request` takes a JSON sourcekitd request and a path to `sourcekitd.framework` and executes that request using that sourcekitd. This is basically equivalent to `sourcekitd-test -json-request-path` but it works even if the toolchain with `sourcekitd.framework` doesn’t have a `sourcekitd-test`.
2. `sourcekit-lsp diagnose --request-file` takes a path to a JSON sourcekitd request, gets the source file’s contents from disk and reduces the source file + compiler arguments to create a reduced reproducer. It then copies all files referenced from the compiler arguments to a temporary folder and asks the user to file an issue with that information.
3. `sourcekit-lsp diagnose` without arguments is similar to (2) but looks in OSLog for the last sourcekitd crash.
2024-01-29 23:07:59 -08:00