Commit Graph

17 Commits

Author SHA1 Message Date
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
Alex Hoppen
ea21175dd7 Create BuildSystem in BuiltInBuildSystemAdapter
This finalizes the move of `BuiltInBuildSystem` creation into `BuiltInBuildSystemAdapter` and means that we can set the message handler of the `BuiltInBuildSystem` during initialization instead of using a setter method.
2024-09-09 18:00:05 -07:00
Alex Hoppen
6a9dcd2349 Split determining which build system to use for a workspace and the workspace creation
This allows us to create the build system from a `BuiltInBuildSystemAdapter` when it receives an `InitializeRequest`, which will be done in a follow-up commit.
2024-09-09 17:42:15 -07:00
Alex Hoppen
b490a6fef1 Use buildTarget/inverseSources from BSP to get targets of a source file 2024-09-09 16:31:30 -07:00
Alex Hoppen
63c5ca4a2c Use BuildTargetIdentifier from BSP instead of ConfiguredTarget 2024-09-09 16:31:00 -07:00
Alex Hoppen
e38d37e01c Use workspace/didChangeWatchedFiles from BSP to communicate file changes to the build system 2024-09-09 16:31:00 -07:00
Alex Hoppen
b4d04ce983 Introduce a BuiltInBuildSystemAdapter that can be used to transition BuildSystem to a type that implements BSP 2024-09-09 16:31:00 -07:00
Alex Hoppen
fd0573e4b8 Rename BuildSystem to BuiltInBuildSystem 2024-09-09 16:30:13 -07:00
Alex Hoppen
4d1fa7a7ee Fix a race condition that could cause the build graph to not be generated when doing initial background indexing
We were making the initial `generateBuildGraph` call in `SourceKitLSPServer` from a `Task`. This means that `generateBuildGraph` could be executed after `waitForUpToDateBuildGraph` was called by `SemanticIndexManager`. Thus `waitForUpToDateBuildGraph` returned immediately and no files were background indexed.

Make `generateBuildGraph` immediately schedule a package reload for SwiftPM build systems instead of doing the hop through a `Task`, fixing the race condition.

rdar://135551812
2024-09-09 11:50:18 -07:00
Alex Hoppen
6e0281f79a Don’t block the generation of a build system by build graph generation
We currently load the entire package before generating a `SwiftPMBuildSystem`. That means that the initialize request to SourceKit-LSP is blocked until the package has been loaded, preventing us from offering any sort of functionality, including syntactic functionality like formatting.

Decouple build system creation and build graph generation (aka. package loading for SwiftPM). We can operate with fallback build settings until the build graph has been loaded and reopen the document once the proper build settings are available.

rdar://126644596
2024-09-06 22:51:53 -07:00
Alex Hoppen
50a28bb86a Change FIXME and TODO comments to always have an associated issue
Do one of the following for every `FIXME` or `TODO` comment
- Add an issue that tracks the task
- Remove the comment if we are not planning to address it
2024-08-07 10:00:04 -07:00
Alex Hoppen
c31122b255 Merge pull request #1570 from ahoppen/remove-indexpathmappings
Remove `indexPrefixMappings` from `BuildSystem`
2024-08-05 10:41:05 -07:00
Alex Hoppen
0249741aba Remove indexPrefixMappings from BuildSystem
They weren’t used.
2024-08-01 10:11:48 -07:00
Alex Hoppen
970b44d255 Remove a few @preconcurrency imports
rdar://132378792 is fixed
2024-07-31 17:25:20 -07:00
Alex Hoppen
66f2d86775 Rename SKCore to BuildSystemIntegration 2024-07-25 09:11:13 -07:00