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

move from telescope/path to plenary/path #473

Merged
merged 12 commits into from
Jul 14, 2021

Conversation

anott03
Copy link
Contributor

@anott03 anott03 commented Jan 29, 2021

Closes #387

@anott03
Copy link
Contributor Author

anott03 commented Jan 29, 2021

Some of the changes in the diffs don't make sense... it's showing a bunch of changes regarding the names actions that shouldn't be there. When comparing my code to what I see on master by hand it seems to match. Can someone take a look?

README.md Outdated Show resolved Hide resolved
@Conni2461
Copy link
Member

You probably based this branch on your last branch rather than on master. You could try to rebase it on current master. Not sure if it will work tho 😆

Note: I will look at your plenary work first. I probably won't look at this PR today :)

@anott03
Copy link
Contributor Author

anott03 commented Jan 29, 2021

@Conni2461 I'll try rebasing - thanks!

Note: I will look at your plenary work first. I probably won't look at this PR today :)

Of course. We all have things we need to do :)

@anott03 anott03 changed the title move from telescope/path to plenary/path [WIP] move from telescope/path to plenary/path Jan 29, 2021
@anott03
Copy link
Contributor Author

anott03 commented Jan 29, 2021

This needs to be worked on some more after changes being made to plenary

@Conni2461
Copy link
Member

@anott03 Could you check if this one will be fixed when using path:new #394

Also did you have any luck with rebasing?

@anott03
Copy link
Contributor Author

anott03 commented Jan 31, 2021

@Conni2461 sure I'll take a look at #394 today.

As for the rebasing, I took a step back from telescope and was trying to get everything done with plenary first (which I think I have, so I'll get back to this today or tomorrow). And while I'm at it, I'll switch all instances of vim.fn.getcwd to vim.loop.cwd.

@anott03
Copy link
Contributor Author

anott03 commented Feb 2, 2021

@Conni2461 I just rebased against master, and it seems to have worked (all tests pass, it seems to be running fine, etc.). As for #394, I tested it in the following way:

  1. Checkout telescope master
  2. cd ~/.config/nvim (which is a symlink to ~/repos/dotfiles/nvim
  3. run :Telescope find_files

I then repeated the above steps on my branch, plenaryPath. The results I yielded were the same for both branches, and that is that it successfully listed the files I had in that directory. I'm not sure if that means the issue has been solved, or if I need to take other steps to reproduce it. I'll also perform these tests on a symlink that doesn't point to a git repo and see if that makes a difference.

@tjdevries
Copy link
Member

(What do you need me to do 😆 )

@anott03
Copy link
Contributor Author

anott03 commented Feb 6, 2021

@tjdevries Unless there are changes that need to be made to this code before it can be merged (stuff to resolve the failed linting test maybe?) I'd say there isn't much to do regarding this issue until the PR to plenary has been merged since this is dependent on that. It's probably worth it to see if someone can recreate #394. I've tried and haven't been able to.

@anott03
Copy link
Contributor Author

anott03 commented Mar 15, 2021

@Conni2461 I don't think we should wait on Path:escape before merging this... I think it makes more sense just to resolve the conflicts and merge this as is and then create a separate PR for escaping paths if necessary.

@Conni2461
Copy link
Member

Works for me. I am currently really busy (sorry exams and stuff) so i won't be around that much but i 100% trust @elianiva if he wants to finish it with you :)

@anott03
Copy link
Contributor Author

anott03 commented Mar 15, 2021

No worries - good luck with the exams! I'll talk to @elianiva here or on gitter when he's free :)

@elianiva
Copy link
Member

probably better talk it here, Gitter is a bit janky for me. It deletes DM from other people randomly for some reason 😆

@tjdevries
Copy link
Member

Do you need anything from me?

@anott03
Copy link
Contributor Author

anott03 commented Mar 16, 2021

@tjdevries I believe this is good to go - it just needs to be reviewed by someone. I had talked with Conni about waiting until we have a Path:escape in plenary but I think we should just merge this as is and then open a new PR if/when an escape function comes around.

@anott03
Copy link
Contributor Author

anott03 commented Mar 20, 2021

@elianiva Can you take a look at the second conflict in actions/init.lua? That's the only one I'm not quite sure how to resolve yet...

@elianiva
Copy link
Member

remove this part from your branch and edit this file accordingly, specifically this line and this line

We've moved the action that was previously in actions/init.lua to actions/set.lua. Hope it helps :)

@anott03
Copy link
Contributor Author

anott03 commented Mar 22, 2021

Makes sense - thanks :)

@anott03
Copy link
Contributor Author

anott03 commented Apr 2, 2021

I ended up resetting and doing everything over again because it turned out to be easier than rebasing against the latest changes (at least for me). In the processing of doing everything I realized that not only did telescope.path have some path related functions, but so did utils, so this now gets rid of any path functions in utils in favor of plenary as well.

@Conni2461 and @elianiva can one of you check this out?

lua/telescope/path.lua Outdated Show resolved Hide resolved
@Conni2461
Copy link
Member

Also we wanna remove telescope.path so we should replace each function with a error message that says. "Please use plenary.path" or similar. So extensions know that they have to move to the new way and then remove the whole module in a month or so.

Similar to

utils.strdisplaywidth = function()
error("strdisplaywidth deprecated. please use plenary.strings.strdisplaywidth")
end
utils.utf_ptr2len = function()
error("utf_ptr2len deprecated. please use plenary.strings.utf_ptr2len")
end
utils.strcharpart = function()
error("strcharpart deprecated. please use plenary.strings.strcharpart")
end
utils.align_str = function()
error("align_str deprecated. please use plenary.strings.align_str")
end
for example (i think we could remove those functions now btw)

lets finish this pr in the next two days. I am here if you need me :)

@anott03
Copy link
Contributor Author

anott03 commented Jul 11, 2021

@Conni2461 how do we typically handle deprecating things like path.separator which are variables rather than functions?

@anott03
Copy link
Contributor Author

anott03 commented Jul 11, 2021

Could we do something like this?

local path = setmetatable({}, {
  __index = function()
    error("telescope.path is deprecated. please use plenary.path instead")
  end
})

return path

@Conni2461
Copy link
Member

Yes thats better for our case because we deprecate a whole module, not just a couple of functions 👍

Copy link
Member

@Conni2461 Conni2461 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I need to test it, so i will run it today and see if something doesnt work. If all works out i'll merge this evening

Thank you very much :) and thank you for your patience :)

@anott03 anott03 changed the title [WIP] move from telescope/path to plenary/path move from telescope/path to plenary/path Jul 12, 2021
@Conni2461 Conni2461 force-pushed the plenaryPath branch 2 times, most recently from 6d388cb to 8980840 Compare July 14, 2021 12:57
@Conni2461
Copy link
Member

I talked with tj for a second. He wants to keep the module for now but throw an error. Just so extensions have a week or so to switch over to plenary.path

I am going to merge this now.

Thanks for all your work and your patience with me :)

@clason
Copy link
Contributor

clason commented Jul 14, 2021

@Conni2461
Copy link
Member

I forgot about this. Calling the function will yell at you tho 😆

@clason
Copy link
Contributor

clason commented Jul 14, 2021

Yeah, but some explanation -- and migration guide! -- would be good since it's not as simple as replacing require'telescope.path' with require'plenary.path' ;)

@Conni2461
Copy link
Member

I'll add one i noticed something else super small too too, i shouldn't have merged. Honest mistake. I was just glad right now that it was done and it didn't break anything inside telescope 😆

@anott03
Copy link
Contributor Author

anott03 commented Jul 14, 2021

@Conni2461 thanks for all your help! Lmk if there's anything else you'd like me to do :)

And sorry again for disappearing for weeks on end!

l-kershaw added a commit to l-kershaw/telescope.nvim that referenced this pull request Jul 14, 2021
- adds option to configure the length of shortened parts of filenames
- only affects paths when "shorten" is in `path_display`
- reimplemented based on changes in nvim-telescope#473 and nvim-telescope#839
l-kershaw added a commit to l-kershaw/telescope.nvim that referenced this pull request Jul 16, 2021
- adds option to configure the length of shortened parts of filenames
- only affects paths when "shorten" is in `path_display`
- reimplemented based on changes in nvim-telescope#473 and nvim-telescope#839
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.

Move from telescope/path to plenary/path
6 participants