Commit Graph

3177 Commits

Author SHA1 Message Date
Alex Hoppen
ec235dfd28 Merge pull request #1755 from ahoppen/shorter-diags-debounce-duration
Reduce the debounce duration to publish diagnostics to 1s
2024-10-14 13:26:35 -07:00
Alex Hoppen
38ac399b58 Reduce the debounce duration to publish diagnostics to 1s
We received two feedbacks that the 2s timeout is too long. 2s was a somewhat arbitrary choice, let’s reduce it to 1s.

Fixes #1753
2024-10-14 09:51:43 -07:00
Alex Hoppen
213b62f27a Merge pull request #1717 from ahoppen/ahoppen/cross-compile-lsp
Build sourcekit-lsp for multiple arches and lipo them
2024-10-11 15:14:08 -07:00
Alex Hoppen
1671025ead Merge pull request #1752 from swiftlang/ahoppen-patch-1
Highlight in non-Apple extended logging that the section does not app ly to macOS
2024-10-11 15:09:21 -07:00
Alex Hoppen
17b13a935a Merge pull request #1751 from ahoppen/windows-fixes 2024-10-11 11:31:44 -07:00
Alex Hoppen
25af3dd029 Highlight in non-Apple extended logging that the section does not apply to macOS
Helpful if you glance over the heading.
2024-10-10 23:09:43 -07:00
Rintaro Ishizaki
5802aadf57 Merge pull request #1746 from rintaro/raw-editor-placeholder
Update for EditorPlaceholder SPI changes in swift-syntax
2024-10-10 20:18:17 -07:00
Rintaro Ishizaki
7add264c3e Update for EditorPlaceholder SPI changes in swift-syntax 2024-10-10 11:44:07 -07:00
Alex Hoppen
741f1e52a3 Merge pull request #1749 from ahoppen/skip-testWithTimeoutEscalatesPriority
Skip testWithTimeoutEscalatesPriority
2024-10-10 11:07:57 -07:00
Alex Hoppen
c16e33d281 Miscellaneous adjustments to make tests pass on Windows
This is mostly test infrastructure that needed adjusting.
2024-10-10 09:28:26 -07:00
Alex Hoppen
8e3d519fd0 Skip testWithTimeoutEscalatesPriority
The test is flakey. Disable it until we have an idea of what it is.
2024-10-09 19:47:31 -07:00
Alex Hoppen
b8aca0c6b4 Merge pull request #1747 from ahoppen/default-timeout-sourcekitd
Use the test’s default timeout duration for sourcekitd timeouts
2024-10-09 18:00:55 -07:00
Alex Hoppen
4481b4b2cb Merge pull request #1748 from ahoppen/test-name-assertcodeactions
Pass the test name through `assertCodeActions`
2024-10-09 17:48:07 -07:00
Alex Hoppen
79ca537a40 Pass the test name through assertCodeActions 2024-10-09 14:20:54 -07:00
Alex Hoppen
2623b4949d Use the test’s default timeout duration for sourcekitd timeouts
Otherwise, we are stuck with the timeout default of 120s and the test runner can’t increase it.
2024-10-09 13:55:18 -07:00
Alex Hoppen
aa0aa927ca Stop using TSCBasic.resolveSymlinks and URL.resolvingSymlinksInPath 2024-10-09 13:16:57 -07:00
Alex Hoppen
3bf05ad51f Merge pull request #1743 from ahoppen/withtimeout-issue 2024-10-08 21:58:11 -07:00
Alex Hoppen
77f02fc706 Yield TimeoutError before cancelling body task in withTimeout
Otherwise, the body task might finish before we yield the `TimeoutError` and thus `withTimeout` would not actually throw a `TimeoutError`.

rdar://137171114
2024-10-08 15:26:02 -07:00
Alex Hoppen
3e01a5c42c Merge pull request #1741 from plemarquand/fix-lsp-init-shadowing
Fix inadvertent shadowing of ClientCapabilities subtypes
2024-10-08 12:57:53 -07:00
Paul LeMarquand
d8b0577465 Fix inadvertent shadowing of ClientCapabilities subtypes
When removing the LanguageServerProtocol namespace from types in
ClientCapabilities (#1734), some types inadvertently started shadowing
themselves. This lead to client initialization errors when the
initialization request couldn't be decoded:

```
type mismatch at params.capabilities.textDocument.completion.completionItemKind.valueSet.Index 0 : Expected to decode Dictionary<String, Any> but found number instead.
```

Disambiguating these inner types in ClientCapabilities fixes decoding.
2024-10-08 12:24:24 -04:00
Alex Hoppen
dd95a3d7fe Merge pull request #1738 from ahoppen/pop-outstanding-request-on-crash
Remove elements from `outstandingRequests` on crash
swift-DEVELOPMENT-SNAPSHOT-2024-10-08-a
2024-10-07 16:06:52 -07:00
Alex Hoppen
dcafaa9e3c Merge pull request #1740 from plemarquand/fixup-config-link 2024-10-07 13:51:49 -07:00
Paul LeMarquand
c55db2f23b Fix broken link to Configuration File documentation 2024-10-07 08:53:31 -04:00
Alex Hoppen
e50b4d78e5 Remove elements from outstandingRequests on crash
Otherwise, we can have a retain cycle where the `OutstandingRequest` keeps the `JSONRPCConnection` alive.

Also move the code that handled `outstandingRequests` out of the `Task` because `outstandingRequests` should only be accessed from `queue`.
2024-10-04 17:22:26 -07:00
Alex Hoppen
aa7389c60f Merge pull request #1735 from ahoppen/frozen-messagekind
Mark `MessageDecodingError.MessageKind` as `@frozen`
2024-10-04 15:55:51 -07:00
Alex Hoppen
87db1bf614 Merge pull request #1736 from ahoppen/weak-back-ref
Make `BuildSystemManager` only keep a weak reference to `SourceKitLSPServer`
2024-10-04 15:54:24 -07:00
Alex Hoppen
e1e00351fe Merge pull request #1737 from ahoppen/priority-escalation-high-priority
In `withTaskPriorityChangedHandler` execute the task that watches for priority changes with high priority
2024-10-04 15:54:17 -07:00
Alex Hoppen
dff72f1807 In withTaskPriorityChangedHandler execute the task that watches for priority changes with high priority
I saw a nondeterministic test failure of `AsyncUtilsTests.testWithTimeoutEscalatesPriority` and I believe this was the cause.

Also refactor a few test helper functions on the way.
2024-10-04 09:57:52 -07:00
Alex Hoppen
52599974a8 Make BuildSystemManager only keep a weak reference to SourceKitLSPServer
This allows us to free `SourceKitLSPServer` in tests even if there are outstanding messages from the build server to be handled.
2024-10-03 17:41:54 -07:00
Alex Hoppen
62271b47b7 Merge pull request #1734 from ahoppen/lsp-module-references
Remove references to the `LanguageServerProtocol` modules in that module itself
2024-10-03 14:31:55 -07:00
Alex Hoppen
06f6f8f17b Remove references to the LanguageServerProtocol modules in that module itself 2024-10-02 14:16:33 -07:00
Alex Hoppen
01640ee68f Merge pull request #1731 from ahoppen/bsp-implementation-documentation
Add a document that describes the basic steps needed to implement a BSP server
2024-10-02 10:27:30 -07:00
Alex Hoppen
ee29e31fb4 Merge pull request #1719 from ahoppen/explicit-bsp-shutdown
Explicitly shut down the build server when SourceKit-LSP is shut down
2024-10-02 10:27:15 -07:00
Alex Hoppen
2e61d33645 Mark MessageDecodingError.MessageKind as @frozen 2024-10-02 09:34:49 -07:00
Alex Hoppen
9a3a0df7a7 Merge pull request #1730 from ahoppen/finish-immediately-timeout
When `withTimeout` hits a timeout, don’t wait for cooperative cancellation before returning
2024-10-01 09:53:20 -07:00
Alex Hoppen
86653b3c45 When withTimeout hits a timeout, don’t wait for cooperative cancellation before returning
Previously, when we hit the timeout in `withTimeout`, we just cancelled `body` but relied on cooperative cancellation before the caller could continue. Since the caller is obviously no longer interested in the operation, we can return with `CancellationError` immediately.

Fixes #883
rdar://116705684
2024-09-30 15:55:09 -07:00
Alex Hoppen
f6eac86f3d Merge pull request #1724 from ahoppen/tracing-file
Add subcommand to visualize the requests running concurrently using a trace file
2024-09-30 15:50:22 -07:00
Alex Hoppen
3c7aa6f438 Merge pull request #1715 from ahoppen/bsp-cancellation
Share implementation of message handling on an `AsyncQueue` between `BuildSystemIntegration` and `SourceKitLSPServer`
2024-09-30 15:31:54 -07:00
Alex Hoppen
84878fe3a9 Merge pull request #1705 from ahoppen/watch-files-by-build-system
Allow build systems to specify the files to watch for changes
2024-09-30 15:31:41 -07:00
Alex Hoppen
c2d1c15310 Add a document that describes the basic steps needed to implement a BSP server 2024-09-30 14:51:07 -07:00
Alex Hoppen
dd19baa302 Add subcommand to visualize the requests running concurrently using a trace file
Showing the list of active requests didn’t turn out to be very useful for debugging. What is more useful, however, is to visualize the requests as the get enqueued and handled in a trace chart. This gives a very intuitive view of which request is blocking another request from getting executed.
2024-09-30 12:04:11 -07:00
Alex Hoppen
d25b65c307 Explicitly shut down the build server when SourceKit-LSP is shut down
The build server is automatically shut down using a background task when `BuildSystemManager` is deallocated.

This, however, leads to possible race conditions where the shutdown task might not finish before the test is done, which could result in the connection being reported as a leak. To avoid this problem, we want to explicitly shut, down the build server when the `SourceKitLSPServer` gets shut down.
2024-09-30 11:57:39 -07:00
Alex Hoppen
4e53c01944 Merge pull request #1729 from ahoppen/reduce-public-imports
Reduce the number of public imports
2024-09-30 11:43:44 -07:00
Alex Hoppen
7befd0c648 Share implementation of message handling on an AsyncQueue between BuildSystemIntegration and SourceKitLSPServer
This gives us cancellation support for `BuiltInBuildSystemAdapter`.
2024-09-30 10:42:46 -07:00
Alex Hoppen
36478d87ed Allow build systems to specify the files to watch for changes
rdar://136014553
Resolves #1671
2024-09-30 10:33:32 -07:00
Alex Hoppen
8861f3a88d Merge pull request #1721 from ahoppen/improve-bsp-crash-recovery-test
Improve `BuildServerBuildSystemTests.testCrashRecovery`
2024-09-30 10:23:34 -07:00
Alex Hoppen
d842579402 Merge pull request #1712 from ahoppen/build-system-logging-improvements
Improve logging surrounding build systems
2024-09-30 08:11:40 -07:00
Alex Hoppen
947e5269c4 Reduce the number of public imports 2024-09-30 07:50:12 -07:00
Alex Hoppen
431a1c7e4f Merge pull request #1710 from ahoppen/internal-imports
Adopt `InternalImportsByDefault`
2024-09-30 02:43:14 -07:00
Alex Hoppen
65395704e7 Merge pull request #1722 from ahoppen/guard-test-experimental-swiftpm
Only execute `testCodeCompletionShowsUpdatedResultsAfterDependencyUpdated` if SwiftPM supports experimental-prepare-for-indexing
2024-09-29 10:05:38 -07:00