Skip to content

Commit

Permalink
First cut at Phoenix 1.3 projections. Fixes c-brenn#10
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Neufeld committed Feb 12, 2018
1 parent 723be12 commit 1b85b0e
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions autoload/phoenix.vim
Original file line number Diff line number Diff line change
Expand Up @@ -235,46 +235,54 @@ function! phoenix#setup_custom_transformations()
endfunction
endfunction

" TODO: Missing channel
function! phoenix#projections() abort
return {
\ "web/controllers/*_controller.ex": {
\ "type": "controller",
\ "alternate": "test/controllers/{}_controller_test.exs",
\ "template": s:template_for('controller', 'Controller')
\ "lib/*.ex": {
\ "type": "module",
\ "alternate": "test/{}_test.exs"
\ },
\ "web/models/*.ex": {
\ "type": "model",
\ "alternate": "test/models/{}_test.exs",
\ "template": s:template_for('model', 'Model')
\ "test/*_test.exs": {
\ "type": "test",
\ "alternate": "lib/{}.ex"
\ },
\ "web/channels/*_channel.ex": {
\ "type": "channel",
\ "alternate": "test/channels/{}_channel_test.exs",
\ "template": s:template_for('channel', 'Channel')
\ "lib/**/controllers/*_controller.ex": {
\ "type": "controller",
\ "alternate": "test/{dirname}/controllers/{basename}_controller_test.exs",
\ "template": s:template_for('controller', 'Controller')
\ },
\ "web/views/*_view.ex": {
\ "type": "view",
\ "alternate": "test/views/{}_view_test.exs",
\ "template": s:template_for('view', 'View')
\ "lib/**/templates/*.html.eex": {
\ "type": "template",
\ "alternate": "lib/{dirname}/views/{basename}_view.ex"
\ },
\ "test/*_test.exs": {
\ "type": "test",
\ "alternate": "web/{}.ex",
\ "template": s:template_for('test', 'Test')
\ "lib/**/views/*_view.ex": {
\ "type": "view",
\ "alternate": "test/{dirname}/views/{basename}_view_test.ex",
\ "template": s:template_for('view', 'View')
\ },
\ "web/templates/*.html.eex": {
\ "type": "template",
\ "alternate": "web/views/{dirname|basename}_view.ex"
\ "lib/*/router.ex": {
\ "type": "router",
\ "alternate": "lib/{}/router.ex"
\ },
\ "web/static/css/*.css": { "type": "stylesheet" },
\ "web/static/js/*.js": { "type": "javascript" },
\ "web/router.ex": { "type": "router" },
\ "README.md": { "type": "docs" },
\ "docs/*.md": { "type": "docs" },
\ "assets/css/*.css": { "type": "css" },
\ "assets/js/*.js": { "type": "js" },
\ "config/*.exs": { "type": "config" },
\ "mix.exs": { "type": "mix" },
\ "*": { "start": "mix phoenix.server",
\ "path": "web/**"
\ "config/config.exs": { "type": "config" },
\ "mix.exs": { "type": "mix" },
\ "priv/repo/seeds.exs": { "type": "seeds" },
\ "priv/repo/migrations/*.exs": {
\ "type": "migration",
\ "make": "mix ecto.migrate"
\ },
\ "*": {
\ "console": "iex -S mix",
\ "make": "mix compile",
\ "start": "mix phx.server"
\ },
\ }

endfunction

" }}}
Expand Down

0 comments on commit 1b85b0e

Please sign in to comment.