-
Notifications
You must be signed in to change notification settings - Fork 304
Merge main
into release/6.0
#1199
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
ahoppen
merged 39 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-04-23
Apr 24, 2024
Merged
Merge main
into release/6.0
#1199
ahoppen
merged 39 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-04-23
Apr 24, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ent:)` This initializer was only introduced very recently since `IncrementalEdit` stores the replacement bytes instead of just the replacement length. We are now changing `IncrementalEdit` store the range it’s replacing as `Range<AbsolutePosition>` instead of `ByteSourceRange`. Companion of swiftlang/swift-syntax#2588
…t/tests` request This allows us to return swift-testing tests within a single document. It does not look for swift-testing tests workspace-wide (the `workspace/tests` request), which will be a follow-up PR.
Otherwise, the date formatters always output the time in GMT, which has confused me multiple times. Setting the user’s local time zone will emit the date in the user’s local time zone and include the time zone offset to GMT in the date as well.
…kit-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
This change includes a number of new refactoring code actions that build on the syntax refactorings for the SwiftRefactor module of swift-syntax: * Add digit separators to an integer literal, e.g., `1000000` -> `1_000_000`. * Remove digit separators from an integer literal, e.g., 1_000_000 -> 1000000. * Format a raw string literal, e.g., `"Hello \#(world)"` -> `##"Hello\#(world)"##` * Migrate to new if let syntax, e.g., `if let x = x { ... }` -> `if let x { ... }` * Replace opaque parameters with generic parameters, e.g., `func f(p: some P)` --> `func f<T1: P>(p: T1)`. This is generally easy to do, requiring one conformance to provide a name for the refactoring: extension AddSeparatorsToIntegerLiteral: SyntaxRefactoringCodeActionProvider { public static var title: String { "Add digit separators" } }
…refactorings Introduce new refactoring code actions based on the Swift syntax tree.
…type-hierarchy Instead of returning an empty array in `prepareTypeHierarchy`, sourcekit-lsp should return `nil`
See comment in `workspaceForDocument` that explains the race.
…thesized extensions For example when trying to go-to-definition to `filter` on `Array`, we get a USR `s:s14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKF::SYNTHESIZED::s:Sa`. We were trying to look it up in the index, which failed because synthesized extension methods are not indexed. Instead, consult the `module` and `groupName` that `sourcekitd` returns in the cursor info request to decide which module to jump to. rdar://126240558
…discovery Implement test discovery for swift-testing tests for the `textDocument/tests` request
…-race-condition Fix a race condition during the computation of `uriToWorkspaceCache`
…-range Adjustment for the removal of `IncrementalEdit(offset:length:replacement:)` 🤝 swift-syntax#2588
…tests Otherwise we can get into race conditions where we run a request before the index has actually been updated. While at it, also add logging when IndexStoreDB has been updated. rdar://126635046
Truncate log message after 10.000 characters to avoid flooding the log with huge log messages (eg. from a sourcekitd response). 10.000 characters wasn't chosen because it seems to fit the result of most sourcekitd responses that are not generated interface or global completion results (which are a lot bigger).
With swiftlang/swift#72930 we can use the `containedBy` instead of `calledBy` relation for the call hierarchy, which allows us to show unapplied function references in the call hierarchy as well. rdar://123769825
…og-message Truncate log message in `NonDarwinLogger` at 10.000 characters
…tion-refs-in-call-hierarchy Show unapplied function references in call hierarchy
rdar://126488098
Set time zone to the user's local time zone when using date formatters
…-interface Fix jump-to-definition to methods in swift interfaces that are in synthesized extensions
…-in-tests Wait for indexstore-db to update after building a SwiftPM project in tests
…ovements Slightly simplify code completion logic
Make hover popover prettier
This workspace-wide syntactic test index is used for two purposes: - It is used for XCTests instead of the semantic index for files that have on-disk or in-memory modifications to files - It is uses for swift-testing tests, which are only discovered syntactically. rdar://119191037
…ning files in batches
…ule` file has been changed When the client sends us `workspace/didChangeWatchedFiles` notification of an updated `.swift` file, we should refresh the other open files in that module since they might be referencing functions from that updated file. If a `.swiftmodule` file has been updated, we refresh all the files within the package since they might import that module. Technically, we would only need to refresh files that are in module that are downstream of the updated module but we don’t currently have that information easily available from SwiftPM. Also, usually, if the client has a file from a low-level module open, he’ll be working on that module which means that such an optimization won’t help. The real solution here is to wait for us to finish preparation (which we would exactly know when it finishes since sourcekit-lsp would schedule it) but for that we need to implement background preparation. Fixes swiftlang#620 Fixes swiftlang#1116 rdar://99329579 rdar://123971779
- Change name of request in reproducer bundle from `request.json` to `request.yml` because it’s a YAML file, not a JSON file - Change names of diagnose components to use dashes instead of camel case
@swift-ci Please test |
… in cursor info The formatting of these hover responses contains a newline if we don’t have a raw documentation response. Skip these tests if sourcekitd doesn’t return the raw documentation in cursor info, like we do with other tests in this file. This ensures that all tests are passing in Xcode 15.4 again.
bnbarham
approved these changes
Apr 24, 2024
…replacement:)`" This reverts commit 2137056.
@swift-ci Please test |
Minor improvements to the diagnose subcommand
…d-toolchains Skip a few hover tests if sourcekitd doesn’t return raw documentation in cursor info
…ndex again after it got deleted once
…d-dependencies Reload a file when other files within the same module or a `.swiftmodule` file has been changed
@swift-ci Please test |
@swift-ci Please test Windows |
@swift-ci Please test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the following PRs to
release/6.0
textDocument/tests
request #1151uriToWorkspaceCache
#1170NonDarwinLogger
at 10.000 characters #1186.swiftmodule
file has been changed #1180