Help debugging alternate issue
Closed this issue · 2 comments
I have the following folder structure:
- src/main/java/com/ggrangel/jaguar/recorder/br/client/fiorino/FiorinoClientWrapperImpl.java
- src/test/java/com/ggrangel/jaguar/recorder/br/client/fiorino/FiorinoClientWrapperImplTest.java
And the following config:
vim.g.projectionist_heuristics = {
["*"] = {
["src/main/java/*.java"] = {
alternate = "src/test/java/{}Test.java",
},
["src/test/java/*Test.java"] = {
alternate = "src/main/java/{}.java",
},
},
}
In the source file, I can alternate to the test. However, in the test, I get the following error: No alternate file
(and it doesn't give me an option to create one).
Also, if I change the second line of config from ["*"]
to ["*.java"]
, nothing works anymore:
What am I missing?
@ggrangel I'm not sure if it's the best way, but it's working for me:
['pom.xml|build.gradle|settings.gradle'] = {
-- projections for java
['src/main/java/*.java'] = {
type = "source",
alternate = { "src/test/java/{}Test.java", "src/test/java/{}ITCase.java", "src/test/java/{}Tests.java",
"src/test/java/{}IT.java" },
},
['src/test/java/*Test.java'] = {
type = "test",
alternate = "src/main/java/{}.java"
},
['src/test/java/*IT.java'] = {
type = "test",
alternate = "src/main/java/{}.java"
},
['src/test/java/*Tests.java'] = {
type = "test",
alternate = "src/main/java/{}.java"
},
['src/test/java/*ITCase.java'] = {
type = "test",
alternate = "src/main/java/{}.java"
}
},
Also, if I change the second line of config from
["*"]
to["*.java"]
, nothing works anymore:
Using *
tells Projectionist that a project exists in literally every directory. This is never what you want to do and Projectionist should probably forbid it entirely.
Instead, try something like src/main/java/&src/test/java/
, which tells it that pair of directories indicates the presence of a project.