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

Fix #565 : Move refactor modules to directory, edit lua files for path change #3

Closed
wants to merge 2 commits into from

Conversation

happy-dude
Copy link
Contributor

@happy-dude happy-dude commented Oct 7, 2020

ref: nvim-treesitter/nvim-treesitter/issues/565

Mirror https://github.com/nvim-treesitter/nvim-treesitter-textobjects directory structure

  • Move lua modules under lua/nvim-treesitter/refactor (instead of lua/nvim-treesitter-refactor)
  • Edit lua files for new path

@happy-dude
Copy link
Contributor Author

Happy #hacktoberfest 😄 ?

@theHamsta
Copy link
Member

Won't this module change cause the breakage a again for the short moment when users install the update until they restart vim?

@theHamsta theHamsta requested a review from steelsojka October 7, 2020 11:42
@happy-dude
Copy link
Contributor Author

happy-dude commented Oct 7, 2020

Won't this module change cause the breakage a again for the short moment when users install the update until they restart vim?

For me, the breakage only happens when I attempt to use the modules and/or enable them. nvim starts fine with the modules disabled. highlight_current_scope (when enabled) was causing a runtime path issue everytime characters were changed that is being reported at nvim-treesitter/nvim-treesitter#565.

EDIT: re: breakage for users who are caught between an loaded outdated plugin and updated one on disk
Yes, will likely error until neovim is restarted.

@theHamsta
Copy link
Member

theHamsta commented Oct 7, 2020

cmd(string.format([[autocmd CursorMoved <buffer=%d> lua require'nvim-treesitter.refactor.highlight_current_scope'.highlight_current_scope(%d)]], bufnr, bufnr))
cmd(string.format([[autocmd BufLeave <buffer=%d> lua require'nvim-treesitter.refactor.highlight_current_scope'.clear_highlights(%d)]], bufnr, bufnr))

you only have to fix these two lines.

. -> -

@happy-dude
Copy link
Contributor Author

Reason why I changed more than that was to make it consistent with how https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/master/lua laid out the modules.

@theHamsta
Copy link
Member

Let's let @steelsojka decide. I kept the file structure to not have to rename anything and be able to have both plugins installed in the transition period.

@happy-dude
Copy link
Contributor Author

If the desire is to maintain the nvim-treesitter-refactor/lua/nvim-treesitter-refactor/*.lua directory structure, then it would also make sense to change https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/master/lua from

lua/nvim-treesitter/textobjects/ -> lua/nvim-treesitter-textobjects/ ?

Suggesting that only as a consistency thing.

The disruption to users seems minor to me considering

  1. treesitter is still under heavy development, so anyone following HEAD can and will experience breakage,
  2. modules were moved out to separate repos as of the past 2 weeks,
  3. number of users is small (judging by the amount of bug reports),
  4. issue with the highlight_current_scope module in HEAD only happens when enable = true is set for it, since it is disabled by default
  5. after the module is updated, the user just needs to restart neovim to fix any errors that pop up from updating the paths.

@stsewd
Copy link
Member

stsewd commented Oct 7, 2020

@happy-dude I think we want to have a separate namespace so it doesn't collide with the main repo.

@happy-dude
Copy link
Contributor Author

happy-dude commented Oct 7, 2020

Okay yeah that makes sense; what would you guys like me to do?

I can wait for @steelsojka or close/edit this PR with the 2-lined changes in highlight_current_scope and make the changes for the textobjects repo?

EDIT: wording

@stsewd
Copy link
Member

stsewd commented Oct 7, 2020

I think is fine changing those two lines so everything starts working again, we can decide if we want to change the structure later :)

@happy-dude
Copy link
Contributor Author

Sounds good to me @stsewd -- created #4

Can close this PR 👍

@steelsojka
Copy link
Collaborator

@happy-dude Thanks for this. Sorry I didn't get back in a meaningful time. I will close this PR. Thanks for you contribution! I'm gonna close this in place of your other PR.

@steelsojka steelsojka closed this Oct 28, 2020
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.

4 participants