Skip to content
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

Multiple options provided to add protocol stubs #1642

Open
plemarquand opened this issue Aug 26, 2024 · 1 comment
Open

Multiple options provided to add protocol stubs #1642

plemarquand opened this issue Aug 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@plemarquand
Copy link
Contributor

Swift version

swiftlang-6.0.0.9.10

Platform

All

Editor

Visual Studio Code

Does the issue reproduce with Swift 6?

Yes

Description

When a struct or class doesn't conform to its protocol sourcekit-lsp provides both a Quick Fix (Add stubs for conformance) and a Refactoring (Add Missing Protocol Requirements). Both of these options produce the same modifications to the code so one of them can be removed. See attached screenshot.

image

Steps to Reproduce

In VS Code with the Swift Extension installed, create a new swift file and add:

protocol Foo {
  func baz()
}

struct Bar: Foo {
}

Hit CMD+. while the cursor is on Bar and observe the options.

Logging

No response

@plemarquand plemarquand added the bug Something isn't working label Aug 26, 2024
@ahoppen
Copy link
Member

ahoppen commented Aug 26, 2024

Synced to Apple’s issue tracker as rdar://134723570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@plemarquand @ahoppen and others