Commit Graph

13 Commits

Author SHA1 Message Date
Alex Hoppen
0d25ce3b97 Merge pull request #1170 from ahoppen/uri-to-workspace-cache-race-condition
Fix a race condition during the computation of `uriToWorkspaceCache`
2024-04-18 18:54:26 -07:00
Alex Hoppen
a6f74fc6dc Fix a race condition during the computation of uriToWorkspaceCache
See comment in `workspaceForDocument` that explains the race.
2024-04-17 21:09:47 -07:00
Alex Hoppen
f482982c47 Instead of returning an empty array in prepareTypeHierarchy, sourcekit-lsp should return nil
Eg. when requesting type hierarchy of a class when the project hasn’t been built, sourcekit-lsp returns an empty array. That causes VS Code to fail with very ambiguous error messages
- MISSING provider
- Cannot read properties of null (reading 'kind')

To work around this, instead of returning an empty array, return `nil` instead.

rdar://126228814
2024-04-16 11:25:56 -07:00
Alex Hoppen
1e3488bfb4 Don’t repeat a function in incomingCalls if it contains multiple calls to the same function
Eg. if we have the following, and we get the call hierarchy of `foo`, we only want to show `bar` once, with multiple `fromRanges` instead of having two entries for `bar` in the call hierarchy.

```swift
func foo() {}
func bar() {
  foo()
  foo()
}
```
2024-04-11 14:35:33 -07:00
Alex Hoppen
15189bb2fa Merge pull request #1149 from ahoppen/ahoppen/structured-tests
Return tests discovered by `workspace/tests` and `textDocument/tests` in a hierarchical format
2024-04-11 11:03:56 -07:00
Alex Hoppen
44b8a82f9e Merge pull request #1165 from ahoppen/container-name-as-call-hierarchy-detail
Show container name as the detail of a call hierarchy item
2024-04-08 16:34:08 -07:00
Alex Hoppen
67a73f47c1 Return document tests in a hierarchical format
Same as for workspace tests, instead of returning a flat list of symbols, return a hierarchical structure.
2024-04-05 20:18:46 -07:00
Alex Hoppen
65b9505081 Return workspace tests in a hierarchical format
This ways the client doesn’t need to create a hierarchical structure using the container names. It is also more flexible and allows nesting of test suites + the addition of labels and tags for swift-testing.

The data structure for `TestItem` has been heavily inspired by VS Code’s `TestItem` for the test explorer, which should make it fairly straightforward to integrate these results into the VS Code test explorer.
2024-04-05 20:16:06 -07:00
Alex Hoppen
30bc65a554 Show container name as the detail of a call hierarchy item
The container name, showing the class a method is defined on, is more useful than the module name.
2024-04-05 10:20:01 -07:00
Alex Hoppen
8e9c19ac61 Don’t fatalError when constructing DocumentURI from an invalid URL 2024-04-04 11:05:49 -07:00
Alex Hoppen
0ea35886e8 Rename sourceKitServer -> sourceKitLSPServer
I forgot to rename the variables when renaming the class from `SourceKitServer` to `SourceKitLSPServer`.
2024-03-20 22:51:28 +01:00
Alex Hoppen
ed5c7e2e39 Rename language specific language services
The naming was quite inconsistent here. Let’s rename these to `LanguageService` to highlight that they belong together.

- ToolchainLanguageServer -> LanguageService
- SwiftLanguageServer -> SwiftLanguageService
- ClangLanguageServerShim -> ClangLanguageService
2024-03-20 22:51:28 +01:00
Alex Hoppen
4b5f7ffd90 Rename SourceKitServer -> SourceKitLSPServer
This avoid ambiguities whether `SourceKitServer` handles sourcekitd or `sourcekit-lsp`.
2024-03-20 22:50:34 +01:00