This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
opdavies.nvim/after/plugin/projectionist.lua
Oliver Davies 265803b240 feat(nvim): configure alternate files for Fractal
Configure `*.twig` and `*.config.yml` as alternate files in
Projectionist.
2023-09-05 12:56:24 +01:00

55 lines
961 B
Lua

local heuristics = {
["composer.json"] = {
["src/*.php"] = {
type = "source",
alternate = "tests/{}Test.php",
},
["src/Controller/*.php"] = {
type = "controller",
},
["src/Model/*.php"] = {
type = "model",
},
["src/Service/*.php"] = {
type = "service",
},
["tests/*Test.php"] = {
type = "test",
alternate = "src/{}.php",
},
},
["fractal.config.js"] = {
["*.config.yml"] = {
alternate = "{dirname}/{basename}.twig",
},
["*.twig"] = {
alternate = "{dirname}/{basename}.config.yml",
},
},
["package.json"] = {
["src/*.ts"] = {
type = "source",
alternate = "tests/{}.test.ts",
},
["src/*.service.ts"] = {
type = "source",
alternate = "tests/{}.test.ts",
},
["tests/*.test.ts"] = {
type = "test",
alternate = "src/{}.ts",
},
},
}
vim.g.projectionist_heuristics = heuristics