Coder Social home page Coder Social logo

redcar_associated_file's Introduction

Redcar Associated File Plugin

What is it?

In a Netbeans Rails Project you can open a view from the action under cursor in the controller you are editing by hitting shft-ctrl-a. That is neat and useful and I dearly missed that function. Since Redcar is plugin based (almost everything is a plugin) I decided to roll my own plugin. This plugin is to mimic that behaviour.

State of this plugin

Alpha: You can now consider this plugin to be in an alpha state.

What is supported

For now, this is limited to Rails projects. Next up on my list are:

  • Jeweler

  • PHP

  • JAVA

  • Perl (CPAN Modules)

in random order.

How to use it

You can jump around files with a simple key press. Here’s the keys, what they do and the rules they follow:

shft-ctrl-a

MVC, stuffs

  • Jump around between M, V and C

  • Jump from a View to the corresponding Action, e.g.: app/views/users/show.html.erb will lead you to +UsersController#show+

  • Jump from an Action to the corresponding View, e.g.: +ProductController#index+ will open app/views/products/index.html.erb

  • When opening the View, the following list of extensions is tried until one is found: erb, html.erb, haml, js.erb, xml.erb

  • Jump from a Model to a Controller, e.g.: when in app/models/invoice.rb you will jump to app/controllers/invoice_controller.rb

shft-ctrl-t

Test stuffs

  • Jump around test files.

  • Opens the unit test for the fixture, e.g.: when in test/fixtures/customers.yml opens test/units/customer_test.rb

  • When in the unit test, opens the model, e.g.: when in app/models/editor.rb opens test/units/editor_test.rb

  • When in the model, opens the unit test

  • When in the controller, opens the functional test, e.g: app/controllers/books_controller.rb opens test/functional/books_controller_test.rb

  • When in the functional test, opens the controller

  • When in a view, opens the functional test for the controller

  • When there is a function under the cursor, or when you are in a view the first test that has a name similar to the function/action name is selected

shft-ctrl-y

Fixture stuffs

  • Jump between unit tests and fixtures

  • Opens the unit test for the fixture

  • Opens the fixture for the unit test

When the corresponding file does not exist, but the directory it is supposed to live in does, the file will be created with a comment on top.

Contributing

If you would like to contribute, for instance by concocting a solid way to change behaviour based on the likely opened project, please fork, make a topic branch and start coding.

If you really want to help me with behavioural changes based on the open project a little discussion would be in order and very much appreciated. :-)

TODO

  • Jump from a fixture to the first usage in the unit test

  • All the things I forgot to mention

  • Add shft-ctrl-m to jump between controllers (& views) and models

© 2010 - Hartog de Mik

This plugin is licensed under the MIT license. See LICENSE.txt for more info.

redcar_associated_file's People

Contributors

hdemik avatar syzspectroom avatar

Stargazers

Mike Kirby avatar  avatar aligo avatar Jakub Arnold avatar Hartog C. de Mik avatar Kirill Nikitin avatar

Watchers

Hartog C. de Mik avatar James Cloos avatar

Forkers

syzspectroom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.