| Age | Commit message (Collapse) | Author |
|
Migrate cl-remove-if-not → seq-filter, cl-remove-if → seq-remove,
cl-some → seq-some, cl-every → seq-every-p, cl-find-if → seq-find,
cl-mapcan → mapcan, cl-union → seq-union, cl-sort → seq-sort,
cl-case → pcase, and delete projectile-difference in favor of
seq-difference. Manual replacements for cl-notany, cl-typep, cl-incf,
cl-remove, and cl-subst.
cl-lib is still required for cl-defun, cl-defmethod, cl-loop, cl-letf,
and cl-flet*.
|
|
projectile-root-top-down used projectile-locate-dominating-file which
stops at the first (bottommost) match going up the directory tree.
This made it behave identically to projectile-root-bottom-up.
Add projectile-locate-dominating-file-top-down which walks the entire
directory hierarchy and returns the topmost match. For example, with
nested Makefiles at both project/ and project/subdir/, searching from
project/subdir/ now correctly returns project/ instead of
project/subdir/.
|
|
projectile-project-dirs previously only returned directories that
directly contain files, missing intermediate directories that contain
only subdirectories (e.g. src/ when it only has src/ComponentA/).
Fix by walking each file path's ancestor directories up to the project
root, so all intermediate directories are included.
|
|
- Use cl-remove-if instead of seq-remove for consistency with the rest
of the codebase.
- Remove unnecessary project/.git/ from test fixture (git init creates it).
- Remove unnecessary projectile-indexing-method binding in test.
|
|
When fd is unavailable or disabled, `git ls-files -zco --exclude-standard`
returns files still tracked in the index even if deleted from disk. This
causes projectile-dir-files-alien to list ghost files. Fix by running
`git ls-files -zd` and removing those entries from the result.
|
|
Wrap the directory-files call in ignore-errors so that unreadable
directories (e.g. .Spotlight-V100 on macOS) are silently skipped
instead of aborting the entire native indexing operation.
|
|
Newer fd versions (8.3.0+) prepend "./" to output. The --strip-cwd-prefix
flag was already added to projectile-generic-command and projectile-git-fd-args,
but this flag doesn't exist in older fd versions, causing errors.
Add post-processing in projectile-files-via-ext-command to strip the "./"
prefix from results as a defensive fallback, matching the existing pattern
in projectile-files-from-cmd.
Fixes #1749
|
|
On case-insensitive filesystems (macOS default), a ~/workspace directory
matches the "WORKSPACE" Bazel marker because file-exists-p returns t for
both files and directories. This causes the home directory to be falsely
detected as a Bazel project root, leading to severe performance issues.
Add a (not (file-directory-p ...)) guard in projectile-root-top-down so
that only regular files can satisfy file-type marker checks.
Fixes #1961
|
|
- Include projectile-cache-file in projectile-globally-ignored-files default
- Add :safe predicate to allow dir-locals configuration
- Add tests for default values and :safe predicate validation
- Update related file and test matching functions to use let* variants
- Improve variable binding consistency and future compatibility
|
|
|
|
|
|
|
|
It's now done outside of `projectile-mode`'s init, which should make Projectile
load faster.
* As a side effect the known projects will be initialized properly even if you're not using `projectile-mode`.
* The projects are read from disk the first time you invoke
`projectile-switch-project` or a similar command.
* We no longer do auto-cleanup of known projects when projectile-mode
starts. I'll think about how to handle this in an efficient manner.
|
|
|
|
|
|
|
|
|
|
The presence of an "src/" directory doesn't say anything about the
type of the project. This commit fixes the dotnet sln project type to
rely on the presence of an .sln file instead of the "src/" directory.
|
|
'buffer-list-update-hook"
This reverts commit 3c92d28c056c3553f83a513a35502b4547d29319.
|
|
|
|
|
|
|
|
Add new custom variable 'projectile-cmd-hist-ignoredups', which can be
used to tweak how duplicates are dealt with in projectile's command
history. The custom variable is identical in behaviour to
'eshell-hist-ignoredups'.
Specifically, the existing default behavior is maintained with the
value of t, which means consecutive duplicates are ignored. A value
of 'erase means only the last duplicate is kept, whilst a value of nil
means all duplicates are kept.
|
|
|
|
|
|
I am the maintainer of projectile for debian. (Aymeric Agon-Rambosson)
As part of the building process of our packages, we run the tests
provided by the upstream maintainers in a clean and empty
environment (no writable $HOME, no internet access, etc...). For
this reason, we sometimes uncover bugs that would remain masked on
the machines of the upstream maintainers, and of the users.
The test "projectile-parse-dirconfig-file" can break in a very
specific setting :
Since version 28.1, emacs has been shipped with
native-compilation, that is the possibility to compile elisp to
native instructions using libgccjit. Since elisp allows the
advising of functions implemented in C ("primitives"), it is
necessary to compile trampolines to replace those functions if we
want to advise them, in order to allow an arbitrary user-defined
function to be run instead.
The test library you use, buttercup, and more specifically its
function spy-on, advises functions routinely.
In the test we're interested in, buttercup (spy-on) changes the
definition of a few primitives in the offending test
(projectile-parse-dirconfig-file), namely file-exists-p,
file-truename and insert-file-contents.
The first one is advised so as to always return t, regardless of
whether the file is really present or not.
The first two are advised without error. The last one, however,
can fail because, being a primitive, a trampoline needs to be
compiled. We have the following backtrace in our build environment
:
comp-subr-trampoline-install(insert-file-contents)
comp-trampoline-search(insert-file-contents)
native-elisp-load("/tmp/buttercupKuLmvD/28.2-4001e2a9/subr--trampoline-696...
error: (native-lisp-load-failed "file does not exists"
"/tmp/buttercupKuLmvD/28.2-4001e2a9/subr--trampoline-696e736572742d66696c652d636f6e74656e7473_insert_file_contents_0.eln")
What happens here is the following : if we are in a situation
where the trampoline corresponding to the function
insert-file-contents is not already present in some eln-cache
directory on the machine, then the function comp-trampoline-search
should return nil, which would trigger the compilation of said
trampoline.
However, since comp-trampoline-search relies on file-exists-p, and
this last one has been advised so as to always answer yes,
comp-trampoline-search tries to load a file that does not exists,
hence our error.
You or your users probably never reach that state, probably
because you can always count on the trampoline being present
beforehand. But if it is not there, you should be able to
reproduce. We always reach that state because we run the tests in
a clean environment, where the trampoline is never present.
This error can be expected whenever a primitive is advised (in our
case insert-file-contents) while file-exists-p is already advised
so as to always return t, and the trampoline corresponding to the
primitive does not already exists on the file system.
There are two possible solutions : the first one is to try and
ensure the trampoline is present by the time of the advice, for
instance by compiling it unconditionally before the test. This is
not entirely reliable, as some environments could inhibit the
saving of this trampoline to the file system (this is what we do,
for instance).
The second one is to exclude the function insert-file-contents
(and indeed, any primitive you would want to advise while
file-exists-p is advised as to always return t) from trampoline
optimisation completely. The variable
native-comp-never-optimize-functions can be used to do just that.
This patch tweaks it accordingly.
|
|
|
|
They should return the bottommost directory that contains a matching file, not
the bottommost directory for the first file matched.
Incidentally, reordered the files created for the test, so it’s easier to follow
the hierarchy. This also necessitated changing `projectile-test-with-files` so
that attempting to create a file before creating the directory that contains it
didn’t fail.
|
|
This address potential issues with project root discovery - e.g. before this change projectile-project-type could return the wrong project type when called with a dir argument, as this was not propagated properly.
|
|
Functions `projectile-add-dir-local-variable` and `projectile-delete-dir-local-variable`
wraps their built-in counterparts. They always use `.dir-locals.el` from root of projectile project.
|
|
This reverts commit f5a2a3ab268b905c796de255e04790e6e69a61ab.
This out we already had this functionality under the name
`projectile-globally-ignored-buffers`.
|
|
|
|
Add local overrides for the project type attributes test-prefix,
test-suffix, related-files-fn, src-dir and test-dir. Add tests
for this new behaviour.
|
|
|
|
When `projectile-project-root` was unable to find a project root for a
directory, it would not cache the negative result, so future invocations would
repeat the (often expensive) search for a project root every time.
With this change, `projectile-project-root` caches failure to find a project
root, when that failure is expected to be permanent, and consults that cache
for speed on subsequent invocations. "Expected to be permanent" means that
either we're trying to find the project root of a local directory, or we're
successfully connected to a remote directory via TRAMP. If the directory isn't
local, but we can't connect to it, we consider that a transient failure and
don't cache it.
Under the hood, this change uses the same `projectile-project-root-cache`
that's used to cache successful attempts to find a project root, but with a new
key `projectilerootless-{dir}`. This should allow cache invalidation to work
as expected.
|
|
Discovered using codespell:
https://github.com/codespell-project/codespell
|
|
|
|
Use "src/" and "test/" as defaults for the src-dir and test-dir
attributes of a project type when toggling between implementation and
test files.
Improve error messages for implementation and test file toggling
|
|
Allow changing of project type precendence in
projectile-update-project-type.
|
|
|
|
|
|
If `projectile-project-buffer-p` is executed in a non-current project,
`default-directory` return current directory.
Since `projectile-project-buffers` contains current buffer, kill
current buffer.
|
|
* Use fd/fdfind when available
* Strip leading ./ from paths produced by find
|
|
|
|
|
|
Add tests for projectile--test-name-for-impl-name,
projectile--impl-file-from-src-dir-fn and add test for
projectile--find-matching-file to check precedence logic is as expected.
|
|
Adds tests for projectile-find-implementation-or-test,
projectile--test-file-override, projectile--complementary-file and projectile--impl-to-test-dir.
|
|
|
|
Add tests for projectile-update-project-types which verify that it
updates existing projects. Add tests for projectile--combine-lists
which test its overriding logic and that it ignores nil values in
secondary plists.
|
|
|