Commit Graph

27 Commits

Author SHA1 Message Date
Alex Hoppen
5709b9ec14 Compute the prefix of orLog only when the closure threw an error
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.
2025-06-05 16:34:22 +02:00
Alex Hoppen
705ae0d699 Require Swift 6.1 to build SourceKit-LSP
Now that Swift 6.1 has been released, we no longer need to support building SourceKit-LSP using Swift 6.1.
2025-04-08 16:09:16 -07:00
Alex Hoppen
8aa8fa0ff8 Remove offensive terms from the codebase 2025-03-07 13:58:02 -08: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
0e22653b5e Merge pull request #2030 from ahoppen/plugin-logging
Add logging for requests handled by the SourceKit plugin
2025-03-05 13:36:54 -08:00
Alex Hoppen
12b38fe1ea Add logging for requests handled by the SourceKit plugin 2025-03-03 12:17:19 -08:00
Alex Hoppen
2305dfab7a Don't escape slashes in various JSONEncoders
This makes the JSON easier to work with, especially for paths.
2025-03-03 07:55:09 -08:00
Alex Hoppen
94d7a22222 Make LogHandlerActor.shared a let
To fix a concurrency error that was surfaced by https://github.com/swiftlang/swift/pull/78652.
2025-02-18 09:46:46 -08:00
Alex Hoppen
16f897aefa Make the SourceKit plugins work on Windows 2025-01-11 06:57:03 +01:00
Alex Hoppen
5709e1a864 Add a SourceKit plugin to handle code completion requests
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.
2025-01-03 14:21:54 +01:00
Alex Hoppen
ea6f06f9e4 Log integers and booleans as public information by default in NonDarwinLogger
`os_log` doesn’t consider integers and bools as private information and neither should `NonDarwinLogger`.

rdar://138659073
2024-11-22 15:45:18 +01:00
Alex Hoppen
1d7c27bc4b Adopt MemberImportVisibility 2024-11-05 21:04:01 -08:00
Alex Hoppen
951e923245 Use withUnsafeFileSystemRepresentation to get the path of a URL on disk
`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
2024-10-21 11:12:30 -07:00
Alex Hoppen
993b90741b Revert "Make logHandler print to stdout instead of stderr"
This reverts commit 6fbddd4867.
2024-10-16 11:15:51 -07:00
Alex Hoppen
6fbddd4867 Make logHandler print to stdout instead of stderr
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`.
2024-10-14 23:27:10 -07:00
Alex Hoppen
8cd831b55d Adopt InternalImportsByDefault 2024-09-27 09:17:13 -07:00
Alex Hoppen
2ec571b529 Revert "Require a Swift 6 compiler to build SourceKit-LSP"
This reverts commit 7ab7c01cdc.

# Conflicts:
#	Package.swift
2024-09-26 18:23:59 -07:00
Alex Hoppen
8d6ff3df9a Consistently use SOURCEKIT_LSP_ as prefix of environment variables instead of SOURCEKIT_LSP 2024-09-25 14:05:46 -07:00
Alex Hoppen
444ce41dec Log all options when opening a SourceKit-LSP workspace
Previously, OSLog was truncating these options after ~1000 bytes, which left out valuable information about the setup.
2024-09-23 08:52:18 -07:00
Alex Hoppen
32613f28c5 Log redacted versions of the requests if private logging is disabled
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.
2024-09-23 08:49:37 -07:00
Alex Hoppen
7ab7c01cdc Require a Swift 6 compiler to build SourceKit-LSP
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.
2024-09-17 16:53:13 -07:00
Alex Hoppen
57e933da97 Move Atomics from SKSupport to SwiftExtensions 2024-09-15 16:28:09 -07:00
Alex Hoppen
1f74b83854 Add configuration options to adjust log level and log privacy level on non-Apple platforms
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
2024-08-06 18:09:38 -07:00
Alex Hoppen
970b44d255 Remove a few @preconcurrency imports
rdar://132378792 is fixed
2024-07-31 17:25:20 -07:00
Alex Hoppen
148f1e5521 Fix an infinite recursion when printing the redacted description of SourceKitLSPOptions 2024-07-30 16:12:03 -07:00
Alex Hoppen
7790706ffd Log the options with which SourceKit-LSP is launched 2024-07-26 08:19:06 -07:00
Alex Hoppen
8c34a76f59 Rename LSPLogging to SKLogging 2024-07-25 09:11:13 -07:00