Skip to content

Jumping between component files in VS Code #1954

Answered by dewski
ryanb asked this question in General
Discussion options

You must be logged in to vote

Has anyone found a good way to do this? I'm considering creating an extension for this but thought I'd ask here first to ensure no one else has done this.

I personally use the will-wow.vscode-alternate-file extension. Here is my .projections.json file:

{
  "app/components/**/*.html.erb": {
    "alternate": "app/components/{}.rb"
  },
  "app/components/**/*.rb": {
    "alternate": "app/components/{}.html.erb"
  },
  "app/*.rb": { "alternate": "test/{}_test.rb" },
  "lib/*.rb": { "alternate": "test/lib/{}_test.rb" }
}

Since no key bindings are set by default I created one (cmd+shift+a) to alternate between the view component and the HTML (Preferences: Open Keyboard Shortcuts (JSON) in th…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ryanb
Comment options

Answer selected by ryanb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants