tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.09k stars 381 forks source link

:Efoo not finding related files #573

Closed jasonkarns closed 3 years ago

jasonkarns commented 3 years ago

I wasn't sure if I should post this here or at vim-rails. I have both installed, but this is occurring in a rails app. Posting here because of the relation to tpope/vim-projectionist#108.

Given the following in config/projections.json:

  "app/graphql/mutations/*.rb": {
    "type": "mutation",
    "related": [
      "app/graphql/types/inputs/{}_input.rb",
      "app/graphql/types/responses/{}_response.rb"
    ],
    "test": "spec/graphql/mutations/{}_spec.rb"
  },
  "app/graphql/types/inputs/*_input.rb": {
    "type": "input"
  },
  "app/graphql/types/responses/*_response.rb": {
    "type": "response"
  },

Per tpope/vim-projectionist#108, I was expecting :Einput from a mutation file (app/graphql/mutations/foo.rb) to open app/graphql/types/inputs/foo_input.rb.

However, instead I receive E471: Argument required

I've tried a few different combinations. Based on my reading between vim-projectionist and vim-rails, I assume that "command": "foo" has been replaced by "type"? And somewhere in one of the docs, I saw it mentioned that "related" is now deprecated in favor of "alternate"? But I couldn't grok how that should be configured or used...

My end goal is to be able to jump to the corresponding input type and response type, from a mutation.

Any advice is much appreciated. (And many thanks for these and your other fantastic vim plugins!)

tpope commented 3 years ago

rails.vim has its own independent projection system that predates projectionist.vim. (I initially intended to eventually unify them but that is looking like a lost cause.) tpope/vim-projectionist#108 does not apply here. Look for "affinity" in the docs.