-
Notifications
You must be signed in to change notification settings - Fork 276
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
Merge main
into release/6.0
#1236
Merged
ahoppen
merged 44 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-07
May 8, 2024
Merged
Merge main
into release/6.0
#1236
ahoppen
merged 44 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-07
May 8, 2024
Conversation
This file contains 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
…o `sourcekit-lsp-diagnose` The name still dated back to when `sourcekit-lsp diagnose` would only reduce sourcekitd crashes. Now it does quite a bit more.
No particular motivation for this change.
This way we’ll be able to use it from the semantic indexer.
This will allow us to conditionally enable background indexing in tests
This allows us to enable background indexing for a workspace based on a value in `SourceKitLSPServer.Options`.
…erver` to `BuildSystemManager` This allows us to determine the toolchain to use during background indexing. It also moves toolchain selection closer to the build system, which is good because when we support multiple toolchains for a single workspace, the build system is what decides which toolchain to use for which document.
The build system has potentially more information about a document's language than we do based on the file’s extension.
… the process if the `Task` is cancelled
This allows us to get rid of the lock.
Rename diagnose bundle created on disk from `sourcekitd-reproducer` to `sourcekit-lsp-diagnose`
Add '-Xswiftc -plugin-path -Xswiftc ${toolchain}/lib/swift/host/plugins' to swiftpm invocations.
[build-script-helper] Prefer just-built plugins to SDK plugins
…toringProvider Rather than only adapt refactoring actions that conform to SyntaxRefactoringProvider, which takes a syntax node and produces a syntax node, adapt to the less-constraining EditRefactoringProvider, which takes a syntax node and produces edits. We can map edits over just as effectively.
…unction This code action takes an undocumented function declaration like func refactor(syntax: DeclSyntax, in context: Void) -> DeclSyntax? and adds stub documentation for the parameters / result / etc., like this: /// A description /// - Parameters: /// - syntax: /// - context: /// /// - Returns:
…ode-action Add "Add documentation" code action to stub out documentation for a function
…ration Miscellaneous commits in preparation for background indexing
Most importantly, the bug report template is now asking for the user’s OS, Swift version and logging.
Since we now have a `.github` folder for issue templates, we can move `CODEOWNERS` to it.
There were two issues with Objective-C XCTest discovery: 1. We were relying on syntactic test discovery after a document is edited. But since we don't have syntactic test discovery for Objective-C tests, this meant that all tests would disappear as a document got edited. Until we get syntactic test discovery for Objective-C, use the semantic index to discover tests, even if they are out-of-date. 2. We were assuming that the `DocumentSymbols` request returned `[DocumentSymbol]` to find the ranges of tests. But clangd returns the alternative `[SymbolInformation]`, which meant that we were only returning the position of a test function’s name instead of the test function’s range. rdar://126810202
…duplicating indentation inferring logic
…owup Use `TokenSyntax.indentationOfLine` from SwiftBasicFormat instead of duplicating indentation inferring logic
Add a syntactic action that takes JSON pasted into a Swift file or placed in a string literal, then turns it into a set of Codable structs that can represent the JSON. Our typical example starts like this: ``` { "name": "Produce", "shelves": [ { "name": "Discount Produce", "product": { "name": "Banana", "points": 200, "description": "A banana that's perfectly ripe." } } ] } ``` and turns into this: ```swift struct JSONValue: Codable { var name: String var shelves: [Shelves] struct Shelves: Codable { var name: String var product: Product struct Product: Codable { var description: String var name: String var points: Double } } } ``` When converting to JSON, we attempt to reason about multiple JSON objects on the same level to detect when there are optional fields, due to either an explicit null or due to the absence of fields in some of the JSON objects that are conceptually stored together. The refactoring itself would live down in the swift-syntax package if not for its dependency on Foundation. We'll move it when appropriate.
Renaming an enum case currently caused invalid code to be generated because we would rename eg. `myCase(String)` to `myNewCase(_ String)`. Fixing the underlying issue requires changes to `sourcekitd`, that are out-of-scope at the moment. For now, just suppress argument label rename for enum cases in SourceKit-LSP and avoid generating invalid code even if just the base name is modified. rdar://127248157
Useful for correlating request IDs with cancellation notifications.
…able Add a syntactic "Add Codable structs from JSON" code action
Add GitHub issue templates
…ssue Prevent rename of argument labels for enum cases
When renaming `func test(foo: Int) {}` to `test2(foo:)`, rename used to report an edit from `foo` to `foo`, which clutters the refactor preview view. We shouldn’t report edits if no text is actually changed. rdar://127291815
Fix test discovery for Objective-C XCTests
Log request ID of received requests
Don’t report no-op rename edits
@swift-ci Please test |
@swift-ci Please test |
@swift-ci Please test Windows |
bnbarham
approved these changes
May 8, 2024
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.
Merge the following PRs into
release/6.0
:sourcekitd-reproducer
tosourcekit-lsp-diagnose
#1220TokenSyntax.indentationOfLine
from SwiftBasicFormat instead of duplicating indentation inferring logic #1225