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

Rename protocol parameters #1692

Open
aisamu opened this issue Oct 22, 2023 · 3 comments
Open

Rename protocol parameters #1692

aisamu opened this issue Oct 22, 2023 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Projects

Comments

@aisamu
Copy link

aisamu commented Oct 22, 2023

Per ericdallo's directions

Although inconsequential, it's sometimes useful to have all the implementation parameter names match the definition's.

Describe the solution you'd like
When we rename a protocol's parameter declaration, all the known implementation's parameters would be renamed accordingly.

Describe alternatives you've considered
Search-and-replace would certainly work, but protocols parameters frequently have very abstract names (this, coll, el) that are frequently found in various unrelated places.

Additional context
I originally attempted to use LSP to rename a protocol's t to this in a large codebase because search-and-replace was matching various other ts (standing for timestamp)

@aisamu aisamu added the enhancement New feature or request label Oct 22, 2023
@ericdallo
Copy link
Member

I wonder if that's the desired behavior always but maybe most of the time, what if someone wants to rename only the local var of t of that protocol and not all the implementations?
maybe we could do that and if anyone complains add a setting for the old way (although there was never a old way for protocols as we don't support rename on function arities of protocols)

@ericdallo ericdallo added this to Low priority in clojure-lsp via automation Oct 22, 2023
@aisamu
Copy link
Author

aisamu commented Oct 22, 2023

I wonder if that's the desired behavior always but maybe most of the time, what if someone wants to rename only the local var of t of that protocol and not all the implementations?

The protocol declaration never has a body, so there would be no benefit to invoking a rename action vs just renaming the symbol directly!

@ericdallo
Copy link
Member

Yeah, for protocols that sounds safe

@ericdallo ericdallo added the good first issue Good for newcomers label Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
clojure-lsp
Low priority
Development

No branches or pull requests

2 participants