Skip to content

Commit 9af86c1

Browse files
authored
Make the important requests run async (#55)
* CommandRunner: Return running process if needed * BazelTargetStore: Add caching and locking * Lock BazelTargetStore when needed * Add WaitUpdatesHandler * PrepareHandler: Remove unneeded cache * PrepareHandler: Run in the background * Process messages concurrently * Update README * Bump all rules_ * Update the example README * Bump sourcekit-lsp * Add support for running aqueries separately * WatchedFileHandler: Do not notify on regular changes * Add output base prewarming, move requests to run async * CommandRunner: Clean up base protocol * Bump BSP to 0.1.0, fix mismatched bzlmod integration * Improve thread-safety handling in general, update tests * Remove log call that didn't compile
1 parent b34ae06 commit 9af86c1

37 files changed

+676
-343
lines changed

.bsp/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sourcekit-bazel-bsp",
3-
"version": "0.0.5",
3+
"version": "0.1.0",
44
"bspVersion": "2.2.0",
55
"languages": [
66
"c",

Example/.bsp/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sourcekit-bazel-bsp",
3-
"version": "0.0.5",
3+
"version": "0.1.0",
44
"bspVersion": "2.2.0",
55
"languages": [
66
"c",

Example/MODULE.bazel

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
bazel_dep(
22
name = "rules_swift",
3-
version = "3.0.2", # 3.1.0 seems to break lldb breakpoints.
3+
version = "3.1.2",
44
repo_name = "build_bazel_rules_swift",
55
)
66

7-
# We need a commit that has not yet made into a release, so overriding it for now
87
bazel_dep(
98
name = "rules_apple",
9+
version = "4.1.2",
1010
repo_name = "build_bazel_rules_apple",
1111
)
12-
archive_override(
13-
module_name = "rules_apple",
14-
sha256 = "0abe1a851d65d64a1692bdc95a0649cba4218f0007d36eda030eb6bdfd6b6937",
15-
strip_prefix = "rules_apple-a9fcb1c3ae6382534d773d73c035035e9764eadb",
16-
url = "https://github.com/bazelbuild/rules_apple/archive/a9fcb1c3ae6382534d773d73c035035e9764eadb.zip",
17-
)
18-
1912

20-
bazel_dep(name = "apple_support", version = "1.22.1", repo_name = "build_bazel_apple_support")
13+
bazel_dep(name = "apple_support", version = "1.23.1", repo_name = "build_bazel_apple_support")
2114

2215
bazel_dep(name = "aspect_bazel_lib", version = "2.9.3")

Example/MODULE.bazel.lock

Lines changed: 9 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is a simple **iOS** app that lets you see sourcekit-bazel-bsp in action. Th
1313
- Reload your workspace (`Cmd+Shift+P -> Reload Window`)
1414
- Open a Swift file to load the extension. It has to be a Swift file; as of writing this will not work if you open a Objective-C file (but they will work fine after the extension is loaded).
1515

16-
After performing these steps, you should already be able to see the basic indexing features in action. It may take a minute or two the first time as the tool currently builds the entire project, but you can see the progress at the bottom of the IDE. You should also be able to see a new `SourceKit Language Server` option on the `Output` tab that shows sourcekit-lsp's internal logs, and after modifying a file for the first time an additional `SourceKit-LSP: Indexing` tab will pop up containing more detailed logs from both tools.
16+
After performing these steps, you should already be able to see the basic indexing features in action. It may take a minute or two the first time, but you can see the progress at the bottom of the IDE. You should also be able to see a new `SourceKit Language Server` option on the `Output` tab that shows sourcekit-lsp's internal logs, and after modifying a file for the first time an additional `SourceKit-LSP: Indexing` tab will pop up containing more detailed logs from both tools.
1717

1818
## Building and Testing
1919

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module(
22
name = "sourcekit_bazel_bsp",
3-
version = "0.0.5",
3+
version = "0.1.0",
44
compatibility_level = 0,
55
)
66

7-
bazel_dep(name = "rules_swift", version = "3.1.1", repo_name = "build_bazel_rules_swift")
7+
bazel_dep(name = "rules_swift", version = "3.1.2", repo_name = "build_bazel_rules_swift")
88
bazel_dep(name = "rules_swift_package_manager", version = "1.3.0")
99
bazel_dep(name = "rules_apple", version = "4.1.2", repo_name = "build_bazel_rules_apple")
10-
bazel_dep(name = "apple_support", version = "1.22.1", repo_name = "build_bazel_apple_support")
10+
bazel_dep(name = "apple_support", version = "1.23.1", repo_name = "build_bazel_apple_support")
1111

1212
swift_deps = use_extension(
1313
"@rules_swift_package_manager//:extensions.bzl",

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let package = Package(
1515
),
1616
.package(
1717
url: "https://github.com/apple/sourcekit-lsp",
18-
revision: "6022af05e92b1fb9e3e17a09753d6434d8f0dc9b"
18+
revision: "1aae2a4c329035163db85d64ae7bc81ee80aaa3c"
1919
),
2020
.package(
2121
url: "https://github.com/apple/swift-protobuf.git",

0 commit comments

Comments
 (0)