Commit Graph

20 Commits

Author SHA1 Message Date
Alex Hoppen
8cd831b55d Adopt InternalImportsByDefault 2024-09-27 09:17:13 -07:00
Alex Hoppen
1fd700b810 Expose all BSP messages used by SourceKit-LSP to BSP servers
The interaction to an out-of-process BSP server still went through the `BuildServerBuildSystem`, which doesn’t forward all messages to the build system and uses the old push-based model for build settings.

If we discover that the BSP server supports the new pull-based build settings model, we now forward all methods to it directly, without going through `BuiltInBuildSystemAdapter`, which has been renamed to `LegacyBuildServerBuildSystem`.

rdar://136106323
rdar://127606323
rdar://126493405
Fixes #1226
Fixes #1173
2024-09-24 22:47:07 -07:00
Alex Hoppen
0bdbb507c9 Review CompilationDatabaseBuildSystem 2024-09-16 10:12:58 -07:00
Alex Hoppen
316790ff7a Review BuiltInBuildSystem 2024-09-16 10:12:34 -07:00
Alex Hoppen
85b2f1fd30 Review BuildServerProtocol module for consistency 2024-09-16 10:10:26 -07:00
Alex Hoppen
5870ad9eb4 Implement InverseSourcesRequest in BuildSystemManager
`buildTarget/inverseSources` is not required to be implemented by BSP servers and we have almost all information needed for it in `BuildSystemManager`.

This also makes sure that `buildTarget/sources` and `buildTarget/inverseSources` actually match each other. Before this change, we had source files like `Package.swift` for which we returned a target from `buildTarget/inverseSources` but that weren’t part of that target’s sources retrieved using `buildTarget/sources`.
2024-09-16 10:08:14 -07:00
Alex Hoppen
29cfda032c Refactor sourceFiles to return a dictionary from DocumentURI to SourceFileInfo instead of a SourceFileInfo array 2024-09-16 10:08:13 -07:00
Alex Hoppen
a96c0913ad Implement addSourceFilesDidChangeCallback in BuildSystemManager 2024-09-13 11:12:40 -07:00
Alex Hoppen
fac21f5976 Implement waitForUpToDateBuildGraph using BSP 2024-09-13 11:12:40 -07:00
Alex Hoppen
12923b6d73 Implement toolchain(for:) using BSP 2024-09-13 11:12:40 -07:00
Alex Hoppen
cc11fe1b02 Implement topologicalSort inside BuildSystemManager using dependency information 2024-09-12 17:26:41 -07:00
Alex Hoppen
bb96ff4c68 Migrate targets(dependingOn:) to BSP 2024-09-12 16:59:03 -07:00
Alex Hoppen
897cd5e775 Implicitly trigger build graph generation when creating a SwiftPMBuildSystem 2024-09-12 16:24:48 -07:00
Alex Hoppen
022a6de6c3 Handle filesDependenciesUpdated in BuildSystemManager instead of the build system
The implementation of which file’s dependencies have been updated is common across all build systems and thus build systems shouldn’t need to implement this logic. This also allows us to remove `BuildSystemDelegate`.
2024-09-12 07:34:12 -07:00
Alex Hoppen
9d94fe36a9 Migrate defaultLanguage(for:) to BSP 2024-09-12 07:34:12 -07:00
Alex Hoppen
c5ba9671f0 Migrate getting the list of all source files to BSP 2024-09-11 13:42:01 -07:00
Alex Hoppen
3a118980b4 Migrate BuildSystem.prepare to a BSP request 2024-09-11 09:48:50 -07:00
Alex Hoppen
7e3f453a7c Remove registerForChangeNotifications
This was only really used for the legacy BSP integration, which we are phasing out in favor of the new `SourceKitOptions` request.
2024-09-11 08:40:12 -07:00
Alex Hoppen
236f566977 Instead of having FileHandlingCapability for a source file, check if it belongs to any targets 2024-09-11 08:27:12 -07:00
Alex Hoppen
f9e468ffba Use BSP requests to get build settings of a source file 2024-09-10 09:30:36 -07:00