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

Feature request: rename files when using the rename action #153

Open
pacien opened this issue Jan 30, 2023 · 3 comments
Open

Feature request: rename files when using the rename action #153

pacien opened this issue Jan 30, 2023 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pacien
Copy link
Contributor

pacien commented Jan 30, 2023

Currently, the rename action modifies the title of a heading and links
referencing it, but the name of the file containing it is left as is.

Would it be possible to have an option (or another distinct code action) to
also rename the file as well?

@artempyanykh
Copy link
Owner

I'd imagine it working slightly differently -- you rename a file using your editor's regular 'rename' functionality and Marksman in response adjusts all the references to the renamed file. LSP has hooks for this such as textDocument/willRename and textDocument/didRename and at least in Emacs with lsp-mode these hooks work; I think neovim also handles this properly.

Most of the required functionality is already present in Marksman as part of title rename refactor. Implementing the hooks for file renaming should be straightforward.

@artempyanykh artempyanykh added enhancement New feature or request good first issue Good for newcomers labels Jan 31, 2023
@edrex
Copy link

edrex commented Feb 15, 2023

Support for file rename with hooks in Helix: helix-editor/helix#5531

@codingluke
Copy link

I just found nvim-lsp-file-operations for neovim. Unfortunately, with my lazyvim config it is not working.

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
Status: 📋 Backlog
Development

No branches or pull requests

4 participants