projectile icon indicating copy to clipboard operation
projectile copied to clipboard

No consistent behavior when running projectile-run-project

Open ram535 opened this issue 4 years ago • 2 comments

I made a function that when I run projectile-run-project , it brings a menu of commands. image

When I run projectile-run-project onces, everything works as expected.

But when run projectile-run-project a second time or more, it doesn't not bring the menu of commands and it just executes the command that was selected the last time.

(use-package projectile
  :init
  (projectile-mode +1)
  :custom
  (projectile-completion-system 'default)
  :config
  (add-to-list 'projectile-project-root-files-bottom-up "pubspec.yaml")

  (projectile-register-project-type 'dart '("pubspec.yaml")
	                                  :test "pub run test"
	                                  :run 'ram/projectile-run-project
	                                  :test-suffix "_test.dart")

  (defun ram/projectile-run-project ()
    (completing-read "Choose: "
                     '("pub get"
                       "webdev serve")))

Projectile 2.3.0snapshot GNU Emacs 28.0.50 Ubuntu 18.04 LTS

ram535 avatar Jun 18 '20 19:06 ram535

I'll check if there was some way to suppress the caching. Typically people always use the same command to "run" a project, that's why we cache it after first invocation. Should be easy to tackle this.

bbatsov avatar Jun 20 '20 07:06 bbatsov

I think this issue is related. I register a common lisp project.

  (projectile-register-project-type 'lisp '("lisp.org" "README.markdown")
                                    :test (format "sbcl --non-interactive --eval '(ql:quickload \"%s/tests\")' --eval '(asdf:test-system :%s)'" (projectile-project-name) (projectile-project-name))
                                    :test-dir "tests/")

When I go to common lisp project and run the command projectile-test-project, everything works fine. But when I go to another common lisp project if I run projectile-test-project, it run the test of the previous project. projectile-project-name does not get update when moving to another project fot the command projectile-test-project.

ram535 avatar Jun 28 '21 04:06 ram535