bbatsov / helm-projectile

Helm UI for Projectile
329 stars 71 forks source link

Cannot switch project to one using TRAMP #152

Open chy-causer opened 3 years ago

chy-causer commented 3 years ago

Expected behavior

Switching project to a TRAMP one should switch the project

Actual behavior

I get the error "You're not in a project". I believe there was a recent fix to projectile to fix TRAMP issues. Projectile now works great but I think there's something here too that needs something changed. Forgive my vagueness as I am very new to Emacs.

Steps to reproduce the problem

C-p p => select a project that is using TRAMP. Disabling helm-projectile allows projectile to select the project fine using the minibuffer.

Backtraces if necessary (M-x toggle-debug-on-error)

Debugger entered--Lisp error: (error "You’re not in a project")
  signal(error ("You’re not in a project"))
  error("You're not in a project")
  helm-projectile-find-file()
  projectile-switch-project-by-name("/ssh:cas:/home/mert/.emacs.d/")
  #f(compiled-function (project) #<bytecode 0x177eb6d>)("/ssh:cas:/home/mert/.emacs.d/")
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal(helm-source-projectile-projects nil "[-] Switch to project: " nil nil "*helm projectile: -*" nil nil nil)
  apply(helm-internal (helm-source-projectile-projects nil "[-] Switch to project: " nil nil "*helm projectile: -*" nil nil nil))
  helm(helm-source-projectile-projects nil "[-] Switch to project: " nil nil "*helm projectile: -*" nil nil nil)
  apply(helm (helm-source-projectile-projects nil "[-] Switch to project: " nil nil "*helm projectile: -*" nil nil nil))
  helm(:sources helm-source-projectile-projects :buffer "*helm projectile: -*" :truncate-lines nil :prompt "[-] Switch to project: ")
  helm-projectile-switch-project(nil)
  funcall-interactively(helm-projectile-switch-project nil)
  call-interactively(helm-projectile-switch-project nil nil)
  command-execute(helm-projectile-switch-project)

Environment & version information

bbatsov commented 3 years ago

It seems to me that this error is coming from help-projectile, as there's no such check in Projectile itself. I'll check if it's an easy fix.

chy-causer commented 3 years ago

Thanks. I believe the line is https://github.com/bbatsov/helm-projectile/blob/master/helm-projectile.el#L754

There is a tantalizing not-require-root variable in that macro, but I don't know enough about the project to comment any further on it.

bbatsov commented 3 years ago

I think the project check fails for TRAMP, unless you're already connected, so probably it needs something like https://github.com/bbatsov/projectile/commit/c8b71639300da597ac24994b22e4ac81f2c34f5e