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

Code actions to convert between computed properties and zero-parameter functions #1246

Open
DougGregor opened this issue May 8, 2024 · 3 comments · May be fixed by #1562
Open

Code actions to convert between computed properties and zero-parameter functions #1246

DougGregor opened this issue May 8, 2024 · 3 comments · May be fixed by #1562
Labels
code action Code action provided by LSP enhancement New feature or request good first issue Good for newcomers

Comments

@DougGregor
Copy link
Member

Description

A computed property:

var asJSON: String { ... }

can also be expressed as a zero-parameter function:

func asJSON() -> String { ... }

We could introduce a pair of code actions that convert from the first to second, or second to first.

@DougGregor DougGregor added the enhancement New feature or request label May 8, 2024
@ahoppen ahoppen added the code action Code action provided by LSP label May 8, 2024
@ahoppen
Copy link
Member

ahoppen commented May 13, 2024

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

@ahoppen ahoppen added the good first issue Good for newcomers label May 14, 2024
@antigluten
Copy link

Hi, @ahoppen!
I'd like to work on this issue, all work has to be done in this repo or we should add new actions to swift-syntax repo?

@ahoppen
Copy link
Member

ahoppen commented Jun 29, 2024

If it's possible to implement the refactoring in the swift-syntax repo, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code action Code action provided by LSP enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants