bbatsov / helm-projectile

Helm UI for Projectile
329 stars 71 forks source link

Harsh freezes if Rust project lacks .git dir #87

Closed MageSlayer closed 6 years ago

MageSlayer commented 7 years ago

Expected behavior

No freezes. Cursor movement is ok

Actual behavior

After opening Rust project without .git directory created, emacs becomes really slow

Following profile trace show helm-projectile as a cause.
- command-execute                                                3217  59%                                                                      
 - call-interactively                                            3217  59%                                                                      
  - byte-code                                                    3206  59%                                                                      
   - helm-M-x-read-extended-command                              3206  59%                                                                      
    - helm-comp-read                                             3206  59%                                                                      
     - helm                                                      3206  59%                                                                      
      - apply                                                    3206  59%                                                                      
       - helm                                                    3206  59%                                                                      
        - apply                                                  3206  59%                                                                      
         - helm-internal                                         3206  59%                                                                      
          - helm-read-pattern-maybe                              3197  59%                                                                      
           - read-from-minibuffer                                3193  59%                                                                      
            - redisplay_internal (C function)                    3148  58%                                                                      
             - eval                                              3148  58%                                                                      
              - format                                           3148  58%                                                                      
               - projectile-project-type                         3148  58%                                                                      
                - projectile-detect-project-type                 3148  58%                                                                      
                 - cl-find-if                                    3148  58%                                                                      
                  - apply                                        3148  58%                                                                      
                   - cl-find                                     3148  58%                                                                      
                    - apply                                      3148  58%                                                                      
                     - cl-position                               3148  58%                                                                      
                      - cl--position                             3148  58%                                                                      
                       - #<compiled 0x101c379>                   3148  58%                                                                      
                        - projectile-go-project-p                2967  54%                                                                      
                         - cl-some                               2967  54%                                                                      
                          - #<compiled 0x101c20b>                2963  54%                                                                      
                             file-name-extension                 2947  54%                                                                      
                        + projectile-verify-files                 181   3%                                                                      
            - timer-event-handler                                  21   0%                                                                      
             + apply                                               21   0%                                                                      
           + helm-update                                            4   0%                                                                      
          + helm-initialize                                         9   0%                                                                      
  + funcall-interactively                                          11   0%                                                                      

Steps to reproduce the problem

Just opening any Rust source file without .git subdir is enough. I have following config.

(require 'helm-config)
(helm-mode 1)

(require 'helm-swoop)
(defmethod helm-setup-user-source ((source helm-source-multi-occur))
  (setf (slot-value source 'follow) 1))

(require 'helm-grepint)
(helm-grepint-set-default-config)
(global-set-key (kbd "C-c g") #'helm-grepint-grep)
(require 'helm-git-grep) ;; Not necessary if installed by package.el

;; Invoke `helm-git-grep' from other helm.
(eval-after-load 'helm
  '(define-key helm-map (kbd "C-c g") 'helm-git-grep-from-helm))

(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-x b") 'helm-mini)
(global-set-key (kbd "M-s o") 'helm-occur)

(require 'helm-files)
(global-set-key (kbd "C-x C-f") 'helm-for-files)

(setq helm-ff-guess-ffap-filenames t)
(setq helm-ff-guess-ffap-urls t)

;; helm + projectile
(projectile-global-mode)
(setq projectile-enable-caching t)
(setq projectile-completion-system 'helm)
(helm-projectile-on)
(setq helm-for-files-preferred-list '(
                      helm-source-projectile-files-list
                      helm-source-projectile-recentf-list
                      helm-source-buffers-list
                      helm-source-recentf
                      helm-source-projectile-directories-list
                      helm-source-projectile-projects
                      helm-source-files-in-current-dir
                      helm-source-moccur
                      helm-source-locate
                      ))

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

Environment & version information

xiongtx commented 6 years ago

It seems that this is the same problem as bbatsov/projectile#1183, which has nothing to do w/ helm-projectile per se.

Upgrade your Projectile and see if the problem is resolved. If not, follow-up there.