Skip to content

Implement SwiftFixIt — a library for deserializing diagnostics and applying fix-its #8585

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 2 commits into from
May 2, 2025

Conversation

AnthonyLatsis
Copy link
Contributor

Motivation:

This is part of the migration tooling initiative for Swift features.

Modifications:

For now, this API accepts a collection of .dia files, deserializes them, and applies fix-its in place. Eventually, it is expected to serve the upcoming swift fixit and swift migrate subcommands and support various filtering options, as well as a stateful, interactive workflow similar to git add --patch.

@xedin
Copy link
Contributor

xedin commented Apr 30, 2025

@swift-ci please test

@xedin
Copy link
Contributor

xedin commented Apr 30, 2025

@swift-ci please test

@xedin
Copy link
Contributor

xedin commented May 1, 2025

@AnthonyLatsis looks like this is still crashing due to ownership issues:

01:12:49  error: compile command failed due to signal 6 (use -v to see invocation)
01:12:49  Begin Error in Function: '$s15SwiftFixItTestsAAC7testAPI33_5E370A7D1BE96F8F725B0FC5556948E3LLyyAB25SourceFileEditExpectationVxQp_t06sourceQ5Edits_SayAB14TestDiagnosticADLLVG11diagnosticstxxQpXEKRvzlFy6Basics12AbsolutePathVKXEfU_SS_QP_Tg5'
01:12:49  Found an operand with a value that is not compatible with the operand's operand ownership kind map.
01:12:49  Value:   %107 = unchecked_bitwise_cast %63 : $SwiftFixItTests.SourceFileEditExpectation to $SwiftFixItTests.SourceFileEditExpectation // user: %108
01:12:49  Value Ownership Kind: unowned
01:12:49  Instruction:
01:12:49       %107 = unchecked_bitwise_cast %63 : $SwiftFixItTests.SourceFileEditExpectation to $SwiftFixItTests.SourceFileEditExpectation // user: %108
01:12:49  ->   %108 = begin_borrow %107 : $SwiftFixItTests.SourceFileEditExpectation
01:12:49  Constraint: <Constraint Kind:any LifetimeConstraint:NonLifetimeEnding>
01:12:49  End Error in Function: '$s15SwiftFixItTestsAAC7testAPI33_5E370A7D1BE96F8F725B0FC5556948E3LLyyAB25SourceFileEditExpectationVxQp_t06sourceQ5Edits_SayAB14TestDiagnosticADLLVG11diagnosticstxxQpXEKRvzlFy6Basics12AbsolutePathVKXEfU_SS_QP_Tg5'
01:12:49  Found ownership error?!
01:12:49  <unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
01:12:49  <unknown>:0: note: triggering standard assertion failure routine

…plying fix-its

For now, this API accepts a collection of `.dia` files, deserializes
them, and applies fix-its in place. Eventually, it is expected to
serve the upcoming `swift fixit` and `swift migrate` subcommands and
support various filtering options, as well as a stateful, interactive
workflow similar to `git add --patch`.
@AnthonyLatsis AnthonyLatsis requested a review from xedin May 2, 2025 00:36
@AnthonyLatsis
Copy link
Contributor Author

@swift-ci please test

@xedin
Copy link
Contributor

xedin commented May 2, 2025

@swift-ci please test Windows platform

@xedin xedin merged commit 366e545 into swiftlang:main May 2, 2025
6 checks passed
@AnthonyLatsis AnthonyLatsis deleted the danaus-plexippus-7 branch May 7, 2025 16:43
@compnerd
Copy link
Member

This PR broke the Windows distribution (CC: @dschaefer2) as it introduced a new library that is not being shipped.

CC: @shahmishal

@AnthonyLatsis
Copy link
Contributor Author

Did these changes not help?

@compnerd
Copy link
Member

@AnthonyLatsis no, those would not help because the new DLL needs to be shipped. swiftlang/swift-installer-scripts#420 is the necessary change to ship a new DLL.

@AnthonyLatsis
Copy link
Contributor Author

I see. @xedin was switching to a dynamic library intended to fix something else?

@xedin
Copy link
Contributor

xedin commented May 12, 2025

That's what the the rest of the targets have i.e. Build and SourceControl.

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.

3 participants