Skip to content

Improve Rename API#69

Closed
clayellis wants to merge 6 commits intoJohnSundell:masterfrom
clayellis:rename
Closed

Improve Rename API#69
clayellis wants to merge 6 commits intoJohnSundell:masterfrom
clayellis:rename

Conversation

@clayellis
Copy link
Contributor

Resolves #67

@JohnSundell
Copy link
Owner

@clayellis Do you think this is still an issue with Files 4.0+?

@clayellis
Copy link
Contributor Author

@JohnSundell the surface area of the rename API didn't change between 3 and 4 — so I think the original motivations from #67 remain. However, I wasn't the one who brought up the issue, I just wrote the "fix", so I'm not super opinionated. Though, I do think this revision is a little more explicit and helps the user clarify their intent.

@maximkrouk
Copy link

maximkrouk commented Sep 25, 2022

#124 is kinda related in terms of what name and what extension is, I suppose that for the hidden files the current PR implementation may treat name as an empty string

Example
.swiftlint -> (change name to .swiftformat) -> .swiftformat.swiftlint
.swiftlint -> (change extension to yml) -> .yml
Instead of
.swiftlint -> (change name to .swiftformat) -> .swiftformat
.swiftlint -> (change extension to yml) -> -> .swiftlint.yml

Btw I think that getting the name and the extension should probably work like this 🤔
.swiftlint -> (name, extension) -> (".swiftlint", "")
.swiftlint.yml -> (name, extension) -> (".swiftlint", "yml")
Maybe even (but the previous one is frankly better)
.swiftlint -> (name, extension) -> (".swiftlint", "swiftlint")
.swiftlint.yml -> (name, extension) -> (".swiftlint", "yml")

@clayellis
Copy link
Contributor Author

Closing, since it's been a few years without activity.

@clayellis clayellis closed this Dec 4, 2022
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.

Rename Item API

3 participants