-
-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update command cache when editing the .dir-locals.el file #1861
Comments
@bbatsov any thoughts? |
I recall there was some command to force a re-read of dir-locals (e.g. |
This won't solve the issue, because the problem is not with the dir-locals per-se, rather with the projectile cache. See the (defun projectile-test-command (compile-dir)
"Retrieve the test command for COMPILE-DIR.
The command is determined like this:
- first we check `projectile-test-cmd-map' for the last
test command that was invoked on the project
- then we check for `projectile-project-test-cmd' supplied
via .dir-locals.el
- finally we check for the default test command for a
project of that type"
(or (gethash compile-dir projectile-test-cmd-map)
projectile-project-test-cmd
(projectile-default-test-command (projectile-project-type)))) Basically after the cache is initialized the dir-locals is not considered anymore. As a solution I was thinking the following:
This would require saving a timestamp (not a fun of this approach). Otherwise projectile should add a function to the Open to other suggestions as well 😃 I would be more than happy to open a merge-request if we agree on a solution. |
I guess a third approach would be a command that people can manually trigger to update the cache when needed, that they can optionally use as a hook function as you suggested. PR welcome! |
Expected behavior
When editing a project
.dir-locals.el
(e.g. updatingprojectile-project-[install|test|run|etc..]-cmd
) theprojectile-*-cmd-map
should be updated such that the first prompt on next invocation should be the latest from.dir-locals.el
.Actual behavior
.dir-locals.el
.dir-locals.el
read for the first time, any change to thedir-locals.el
is not read anymoreSteps to reproduce the problem
.dir-locals.el
file in your project, defining, say,projectile-project-test-cmd
projectile-test-project
(the value read from the.dir-locals.el
will be proposed).dir-locals.el
bufferprojectile-test-project
again ==> the old version of the command is proposedEnvironment & Version information
Projectile version information
Emacs version
GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-03-10
Operating system
Linux 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC
The text was updated successfully, but these errors were encountered: