The fn-view function is great to quickly inspect an implementation, but once we want to edit we could save one step by opening the file at the line where the function starts. We could accomplish this by returning

+[line number] [full path to file]

A patch is coming up in the first comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr’s picture

Status: Active » Needs review
FileSize
748 bytes

Here is a patch. I have tested it with nano, gedit, vi and vim. Applies cleanly on 8.x, 7.x, and 6.x branches.

example:

$ drush fn-view --pipe block_get_blocks_by_region
+313 /home/juampy/projects/drupal/modules/block/block.module
$ vi `drush fn-view --pipe block_get_blocks_by_region`
moshe weitzman’s picture

Status: Needs review » Needs work

Maybe we need a --pattern option where one can specify where the line number should go? For example, Komodo IDE has a different syntax - http://community.activestate.com/faq/komodo-command-line

juampynr’s picture

Title: Return line number on fn-view --pipe so it can be more effective » Allow the output of fn-view --pipe to be formatted for opening it with an editor
FileSize
2.07 KB

Here it is, but used --format instead of --pattern. Let me know if you want me to change it.

juampynr’s picture

Status: Needs work » Needs review

Changing status to needs review.

Status: Needs review » Needs work

The last submitted patch, devel-format-fn-view-pipe-1421882-3.patch, failed testing.

juampynr’s picture

Status: Needs work » Needs review

Output: [Fatal error: Class 'DrupalWebTestCase' not found ...

So it seems that the Testing System is broken ATM.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to all branches. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.