|
From: | Dmitry Gutov |
Subject: | Re: running EDE from a file that is not under a project root dir |
Date: | Wed, 5 Aug 2015 02:18:32 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 |
On 08/04/2015 09:13 PM, Stephen Leake wrote:
But then it uses semantic-symref-derive-find-filepatterns to get the file patterns to pass to grep. Since I'm starting from a text-mode buffer, that returns (*.letter *.article *.te?xt). Which is _not_ what I want; I want *.el.
If we don't want to change too much code, I suppose xref-collect-references could bind semantic-symref-filepattern-alist to a list of one element:
`((,major-mode "*"))Though that will search in all files. To refine it further, indeed we could make the choice based on what the project tells us.
My question is this; what is the minimum change I should make to EDE to support these use cases? I think I need three things: - add a "file patterns" element to the EDE project (or target?) data structure, and have semantic-symref-derive-find-filepatterns check that before the alists.
That's cool, but won't help xref-find-references if EDE isn't used. A hard dependency on EDE could even break the current usage of semantic-symref-find-references-by-name in xref-find-references.
On the other hand, if we introduce project-source-file-patterns, xref-find-references could use it in the semantic-symref-filepattern-alist binding.
And ede-source-file-patterns could be used by semantic-symref-symbol and semantic-symref-regexp.
That issue aside, xref-find-references currently doesn't use project-ignores, nor does it use grep-find-ignored-directories and grep-find-ignored-files. Thought it still works reasonably quickly as long as the "uninteresting" files don't match the file name pattern we search for.
- add an ede-global-project variable that I can set to my current project, to bypass the project root detection. I've proposed the same change to project.el; there, it can be used by one of the project-find functions.
project.el doesn't need that variable. The variable can just as well live in the package you're writing.
[Prev in Thread] | Current Thread | [Next in Thread] |