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

noob question - how to set the project folder #64

Closed
Trid-collab opened this issue Aug 19, 2021 · 8 comments
Closed

noob question - how to set the project folder #64

Trid-collab opened this issue Aug 19, 2021 · 8 comments

Comments

@Trid-collab
Copy link

I am using this extension for the first time. I set up the extension and when opened the nvim in a git enabled root directory, it the telescope project opened a blank panel. After twice it exit from the projects panel and came to the normal mode in my present buffer

@kkharji
Copy link
Member

kkharji commented Aug 19, 2021

did you add something like this to your config:

require('telescope').setup {
  extensions = {
    project = {
      base_dirs = {
        '~/dev/src',
        {'~/dev/src2'},
        {'~/dev/src3', max_depth = 4},
        {path = '~/dev/src4'},
        {path = '~/dev/src5', max_depth = 2},
      }
      hidden_files = true -- default: false
  }
}

@Trid-collab
Copy link
Author

Nope. I assumed that it would detect my git folders when I open nvim from within that to be the project folders

@Trid-collab
Copy link
Author

I have realized the problem. By default when you open the telescope project it enters blank space after the prompt and then positions the cursor. So when I was pressing "c" to add my git folders it was not not working. It started working when I pressed Esc once and brought the cursor to the prompt, it worked. I am not sure if this due to my config or its how Telescope project is - in that case it be better if this was correct to avoid confusion for noob like,

@kkharji
Copy link
Member

kkharji commented Aug 20, 2021

I have realized the problem. By default when you open the telescope project it enters blank space after the prompt and then positions the cursor. So when I was pressing "c" to add my git folders it was not not working. It started working when I pressed Esc once and brought the cursor to the prompt, it worked. I am not sure if this due to my config or its how Telescope project is - in that case it be better if this was correct to avoid confusion for noob like,

hmmm it sound like a bug in your config

Nope. I assumed that it would detect my git folders when I open nvim from within that to be the project folders

Oh I think this is coming soon

@matu3ba
Copy link
Contributor

matu3ba commented Nov 11, 2021

Nope. I assumed that it would detect my git folders when I open nvim from within that to be the project folders

No.

  1. Projects can store files from other projects under MIT license and remove the .git folder. This already breaks experience, because we try to always search for a .git folder until /. So the feature would not work as expected.
  2. It is unclear what the user wants for git worktrees (it also breaks currently).
  3. Automatically keeping track of unnessecary data is an antipattern, if you can not ensure the data can be deleted automatically once its not used anymore (which adds another layer of complexity).
  4. The plugins provides a feature to place (git) folders and automatically include them as projects.
  5. The plugin supports keeping track of deleted git projects and I dont know what the use case is.

So to have this accurately working you need 3 different create commands for 1.current folder (of file), 2.git root folder, 3.git worktree.

If you want this, you can do this with an autocommand. If you provide instructions, we can put it on the wiki for others to reuse.

@embeddedpenguin
Copy link

embeddedpenguin commented Jan 8, 2022

Forgive me if I'm wrong, but isn't this an extension of the existing https://github.com/ahmedkhalf/project.nvim? So shouldn't the patterns assigned in the config for project_nvim also work for the telescope-project extension? I guess I'm just confused on the relation between these two projects. I'm trying to figure out how to configure projects so they can find the root dir based on things other than the .git directory. The previously mentioned repo has no documentation on how to use it while this repo has no instructions on how to configure it, so it seemed super convenient that one provided for the other. I honestly just assumed this telescope extension was the front end and project.nvim was the backend.

@matu3ba
Copy link
Contributor

matu3ba commented Jan 9, 2022

@embeddedpenguin
No, the project was a fork of this project. my bad, correction by karlredmann below.
Personally I think not generating the data in a semi-automated way from cli is more cumbersome and the data format should be a csv for easier usage and integration of third party tools.

After having worked with this plugin for a while and thought about the design and possible user-extensibility,
I think it is an anti-pattern to let a plugin control filesystem besides stuff inside a local project and that this should be the job of either neovim or the user to prevent plugins assuming nasty hidden and persistent file system state or dependencies.

Specifically I think that the notion of what files of a project should be used for a certain feature must be user configurable to enable advanced editing techniques like accurate tracking of file changes across one or multiple projects.

@karlredman
Copy link

@matu3ba,
Just wanted to add a correction here:
I want to point out that project.nvim is not a fork telescope-project.nvim however. project.nvim is a successor to lsp-rooter.nvim.

I also want to add that, in my experience, project management utilities that try to over automate their functionality tend to become cumbersome when trying to mitigate use cases that are outside of said automation. I'm in full agreement that such management utilities should only offer automation features as an option at the most.

I will say that it is not easy trying to flush out the differences between the two aforementioned github repos. For me telescope-project.nvim is looking like the right thing -generally because of some feature/development decisions that have occurred along the way. I think the decision as to which one I chose was "a matter of taste".
[my 2-cents]

@claidler claidler closed this as completed Dec 1, 2023
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

No branches or pull requests

6 participants