Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Kemp committed Jun 16, 2014
1 parent e0d2113 commit 6a2738b
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
Sublime-Dependent
---
### Sublime Dependents

**Work In Progress**

Sublime Text 3 plugin for jumping to the file(s) that depend(s) on the current file.
Sublime Text 3 plugin for finding modules that depend on the current module.

Current scope: AMD and CommonJS applications

### Motivation

When you want to find out which files `require` the module you're looking at, it's annoying as hell to
find the filename of the current file, do a Find All, then sift through the find results to see which
file you want to jump to. **This should be automated.**

### Prerequisite

You need to have Node.js installed and [node-dependents](https://github.com/mrjoelkemp/node-dependents).

`npm install node-dependents`

### Usage

Use `cmd + option + up` to trigger "Go to dependent"
##### Key binding

You need to supply the plugin with a `root` which dictates where to look for dependents.
This value is then sent to [node-dependents](https://github.com/mrjoelkemp/node-dependents).

### Possible implementations:
Add the following to your User defined keyboard bindings: `Preferences` -> `Key Bindings - User`

- Could trigger a Find all search behind the scenes
- Pull up all files that include/use the current file.
- use the filename?
- Could generate a dependency list for all JS files in the top-level directory
- Maintain a hash of files to dependents (a file/key and a list of files that require/include the key)
```javascript
[
{
"keys": ["super+alt+up"],
"command": "dependents",
"args": {"root": "public/assets/js"}
}
]

If there are multiple files, show a dropdown list and let the user choose which dependent to jump to.
```

- Similar to "Go to Definition" functionality
Use `cmd + option + up` to trigger finding the dependents.

Could this also be used for jumping to the call sites of a given function?
* If dependents are found, you'll see them in a quick panel (i.e., dropdown).
* You can select any of the items in the panel to jump to that file
* If no dependents are found a popup will be shown

- would need to know what the cursor is pointing to when the jump command is issued. Might be confusing.
- could also be another key binding.

0 comments on commit 6a2738b

Please sign in to comment.