linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
378 stars 40 forks source link

Look for hatch in correct folder on Mac (Darwin) #146

Closed tomplast closed 1 week ago

tomplast commented 1 week ago

I may have been a little hasty, as it is not working for me either (I thought it did but now I'm not sure). But one thing is sure, the path wasn't correct before. The folder is called "Application Support".

linux-cultist commented 1 week ago

I think you are correct, according to docs it should be ~/Library/Application Support/hatch for the mac (https://hatch.pypa.io/dev/config/hatch/) but I really wish I could look inside that folder to see what it looks like.

If you get the default hatch search working on mac, we can merge it. :) Its the only system I cant test myself.

tomplast commented 1 week ago
Screenshot 2024-06-23 at 17 12 32

Running fd 'python$' ~/Library/Application\ Support/hatch/env/virtual works fine anyway so it's just a question of path escaping to get it working in the plugin.

linux-cultist commented 1 week ago

Yeah all that path escaping is really frustrating. On windows I have to use 4 slashes to represent 2 slashes since \ is an escape character in lua.

You can experiment from inside the plugin also by doing VenvSelect <your command here to list venvs with fd>, for example :VenvSelect ls /tmp as an example. Could be faster to figure out that way since then it actually does gets parsed by lua also.

tomplast commented 1 week ago

Apparently 4 backslashes did the trick, at least for me.

Screenshot 2024-06-23 at 17 53 49
linux-cultist commented 1 week ago

Very interesting. I didn't think that would be needed on a mac, but if it works, it works. Should we merge it in then, you feel like its working?

tomplast commented 1 week ago

Very interesting. I didn't think that would be needed on a mac, but if it works, it works. Should we merge it in then, you feel like its working?

Well it's working for me at least, way better than before :). Egoistically I want you to merge it so I don't have to have local changes / use my own fork ;).

linux-cultist commented 1 week ago

If it works for you, it should work for others too. And the docs are saying that this location is the default one on mac, so.. Let's merge. :)

tomplast commented 1 week ago

@linux-cultist Updated the plugin through Lazy, works like a charm. The simple is often the best :). Thank you for merging!

linux-cultist commented 1 week ago

Well huge thanks for the PR :)