Skip to content

Merge main into release/6.1 #1879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
Dec 10, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 10, 2024

Merge main into release/6.1 except for the following PRs, which I would like to qualify a little longer on main and thus not include in 6.1.

ahoppen and others added 30 commits November 18, 2024 15:28
…ft 5.10 toolchain

swiftlang#1714 changed the background preparation mode to `enabled` but a Swift 5.10 toolchain does not support `--experimental-prepare-for-indexing`. Thus, these tests fail. Skip tests that rely on background indexing when testing SourceKit-LSP with a Swift 5.10 host toolchain.
We made quite a few fixes recently to make sure that path handling works correctly using `URL` on Windows. Use `URL` in most places to have a single type that represents file paths instead of sometimes using `AbsolutePath`.

While doing so, also remove usages of `TSCBasic.FileSystem` an `InMemoryFileSystem`. The pattern of using `InMemoryFileSystem` for tests was never consistently used and it was a little confusing that some types took a `FileSystem` parameter while other always assumed to work on the local file system.
Interpret it as relative to the project root directory if it's a
relative path.
Forgot to enable this upcoming feature when I added it to the Package manifest.
Skip tests that use background indexing when running tests with a Swift 5.10 toolchain
…ibility-windows

Enable `MemberImportVisibility` in the CMake build
…t-relative-scratch-dir

Allow `scratchPath` to be a relative path
Adding an item to `AsyncQueue` was linear in the number of pending queue items, thus adding n items to an `AsyncQueue` before any can execute is in O(n^2). This decision was made intentionally because the primary use case for `AsyncQueue` was to track pending LSP requests, of which we don’t expect to have too many pending requests at any given time.

While we can't fix the quadratic performance issue in general, we can resolve the quadratic issue of `AsyncQueue<Serial>` by making a new task only depend on the last item in the queue, which then transitively depends on all the previous items. `AsyncQueue<Serial>` are the queues that are most likely to contain many items.

Fixes swiftlang#1725
rdar://137886469
…winLogger`

`os_log` doesn’t consider integers and bools as private information and neither should `NonDarwinLogger`.

rdar://138659073
The LSP spec says the result of `shutdown` is `null`, not an empty object.

Fixes swiftlang#1733
rdar://137886488
…ace symbols

Previously, we didn’t take outer types into account or only took one level of container type into account.

Fixes swiftlang#1673
rdar://136078089
Add another import of new Android overlay and remove non-existent file exclusion from package manifest
Fix quadratic performance issue in `AsyncQueue<Serial>`
Log integers and booleans as public information by default in `NonDarwinLogger`
Reply with `null` to `shutdown` request
Don’t crash when opening a file with an empty path
Fully qualify type names in call hierarchy, type hierarchy and workspace symbols
Provide build settings for version-specific package manifests
ahoppen and others added 26 commits December 6, 2024 09:02
…gger

Log which file caused the package to be reloaded
Don’t re-index file if we are waiting for its preparation
`generateBuildGraph` was named misleadingly because the primary purpose of these tasks was to schedule indexing tasks and generating the build graph was just a necessary step for this. Also update it to take into account that multiple tasks scheduling indexing tasks might be running in parallel.
Some SwiftPM functions check whether their observability scope has errors. If we use the same observability scope for all SwiftPM operations during SourceKit-LSP’s lifetime, a single SwiftPM error will set the `hasError` bit in that observability scope for the entirety of SourceKit-LSP’s lifetime, impacting all upcoming SwiftPM operations.

Creating a separate child scope for every operation fixes
When we have background indexing enabled, SourceKit-LSP manages the dependencies. We should thus allow it to update them, eg. after `Package.resolved` was updated.
We frequently compute if a file is descendent of the directory and `URL.pathComponents` is an expensive computation.
The transform to get the transformed result might be expensive, so we should cache its result.
…ackground indexing

Since we enabled background indexing by default, the user is no longer explicitly opting into it. A user might be exclusively working with compilation database projects or BSP server without background indexing support and thus not care that we switched the background indexing default. We shouldn’t bother them with a warning message every time they launch sourcekit-lsp.
…rarchy

Only show call-like occurrences in call hierarchy.
…ntacticindex

Batch updates to the syntactic test index on fileDidChange events
When `\{` is included inside an LSP placeholder, in VS Code will insert `\{` verbatim. At least in VS Code, we only need to escape the closing brace.

While at it, also escape `$` and `\` inside placeholders, according to the LSP spec.
Treat `$/setTrace` as a freestanding message
Improve logic for build graph generation status
Cache path components for directories returned from build system
…-warning

Don’t show warning message when opening projects that don't support background indexing
Don’t escape `{` inside placeholder snippets
Create child scopes for SwiftPM operations
Allow dependency updates in the `index-build` folder
Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Currently, when there‘s a syntax error in a package manifest, we don’t get any build settings from it in SourceKit-LSP and thus loose almost all semantic functionality. If we can’t parse the package manifest, fall back to providing build settings by assuming it has the current Swift tools version.

Fixes swiftlang#1704
rdar://136423767
…-settings

Return compiler arguments for invalid package manifests
…-brace"

This reverts commit 1a708ec, reversing
changes made to 5183889.
…tation-language-service"

This reverts commit 9bbb8f3, reversing
changes made to 21dfaf0.
…is-closed"

This reverts commit 21dfaf0, reversing
changes made to f900b4e.
@ahoppen ahoppen requested a review from bnbarham December 10, 2024 18:37
@ahoppen
Copy link
Member Author

ahoppen commented Dec 10, 2024

@swift-ci Please test

@atrick atrick merged commit f57980a into swiftlang:release/6.1 Dec 10, 2024
0 of 3 checks passed
@ahoppen ahoppen deleted the merge-main-6.1-2024-12-10 branch December 10, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants