redguardtoo / counsel-etags

Fast, energy-saving, and powerful code navigation solution
174 stars 15 forks source link

about ctags cache #82

Closed tt67wq closed 2 years ago

tt67wq commented 2 years ago

When I dropped some code or moved some code block from one file to another, I rescaned my project, but etags navigated me to a wrong place, and that is caused by tags cache.

(when (and tags-file (file-exists-p tags-file)
               ;; TAGS file is smaller when being created.
               ;; Do NOT load incomplete tags file
               (< (counsel-etags-cache-filesize tags-file)
                  (setq file-size (nth 7 (file-attributes tags-file)))))
      (when counsel-etags-debug
        (message "Read file .... %s %s" (counsel-etags-cache-filesize tags-file) file-size))
      (counsel-etags-put (intern tags-file)
                         (list :content
                               (counsel-etags-read-file tags-file)
                               :filesize
                               file-size)
                         counsel-etags-cache))

I was wondering if we can replace '<' to '\/='?

redguardtoo commented 2 years ago

You could set counsel-etags-update-interval to a smaller value. Or M-x counsel-etags-update-tags-force.

tt67wq commented 2 years ago

thank u. counsel-etags-update-tags-force regenerates tag file, but cache still exists and leads to wrong line, will counsel-etags-update-tags-force evict cache?

redguardtoo commented 2 years ago

eb6a131 invalidate cache when force updating tags file (Chen Bin)

tt67wq commented 2 years ago

respect!