projectile-switch-project confuses current and switch to project

Created on 23 Jan 2017  路  12Comments  路  Source: bbatsov/projectile

Expected behavior

When projectile-switch-project is called it should open a file from project which user trying to switch to.

Actual behavior

It correctly find all the files from the project user trying to switch but when user choose a file it's absolute name is made relative to currently opened project not the project user is about to switch to.
It results in: "No such file or directory path_to_current_project/file_name_from_another_project"

Steps to reproduce the problem

  • open first project
  • M-: (projectile-switch-project)
  • choose file from another project depending on completion system

(sometimes it works only with first switch, try to switch back few times)

Environment & Version information

Projectile version information

Projectile 20170106.606

Emacs version

GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2016-09-24

Operating system

Ubuntu 14.04

Most helpful comment

I can confirm that this was the issue helm-projectile#64, and it is fixed for me.

All 12 comments

Experiencing this as well

Hmm, apart from @raxod502's recent changes I don't think we've touched on something that could affect this. Those changes seem unrelated as well. When did you start noticing this issue?

Well I updated my packages yesterday. I am using projectile with the helm-projectile extension, maybe that has something to do? I haven't upgraded packages since two weeks ago. So it might be also helm-projectile :/ @novakboskov do you also use helm-projectile and have updated recently?

I use projectile with helm-projectile and persp-projectile and experience the same problem.

@bbatsov @CestDiego I update packages regularly, like every two or three days. It has started happening yesterday. I'm using helm-projectile and maybe the issue is not even related to projectile itself, according to this issue on helm-projectile's repo.
I'm not sure, so won't close this issue yet.

I'm also experiencing the same problem, I use projectile-0.15.0-cvs, helm-projectile-0.14.0 and macOS

Seems like something was changed inside the helm. See this issue

Dammit... How many times I told myself "DO NOT UPDATE SHIT, FIRST THING IN THE MORNING!". Yet I still do this.

Is this really a projectile issue, or just a helm-projectile issue?

This seems to be a good summary of the problem.

Why does helm-projectile-coerce-file rely on the current Helm buffer for context?

(defun helm-projectile-coerce-file (candidate)
  (with-current-buffer (helm-candidate-buffer)
    (expand-file-name candidate (projectile-project-root))))

I'm not a Helm user, so I can't provide any insight about this.

I can confirm that this was the issue helm-projectile#64, and it is fixed for me.

@4e6 Yes, I can confirm it too. Last update of helm-projectile solved it. Thanks to everyone who spent time on this. :)
I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sweord picture sweord  路  3Comments

breadncup picture breadncup  路  3Comments

abo-abo picture abo-abo  路  7Comments

JSmith-BitFlipper picture JSmith-BitFlipper  路  4Comments

ChinaXing picture ChinaXing  路  5Comments