1.0.5 • Published 3 years ago
@phoenix-plugin-registry/pflynn.quick.import v1.0.5
Quick Require Import for Brackets
Quick shortcut for generating RequireJS/CommonJS import statements like this:
Commands = require("command/Commands"),
Press Ctrl+I to open a file-search popup, find the file you want, and hit Enter – an import line for the file is inserted on the line beneath your cursor. Also supports brackets.getModule(), if you have a src/extensions folder tree.
Caveats
- Only supports CommonJS-style imports (require() calls) - does not support "pure AMD" syntax (array of module names mapping to a list of arguments). Note that RequireJS supports both formats.
- Assumes the root of your require() paths is a folder named "src", "js", "scripts", or "www" (if present) or the root of your Brackets project otherwise.
- You must already have a block of require() calls somewhere in your module (typically near the top)
- Assumes this block is a comma-separated list with one import per line – that is, assumes there's a
var
line at the start and a line ending in;
at the end, with any lines in the middle ending in,
How to Install
Quick Require Import is an extension for Brackets, a new open-source code editor for the web.
To install extensions:
- Choose File > Extension Manager and select the Available tab
- Search for this extension
- Click Install!
License
MIT-licensed -- see main.js
for details.
Compatibility
Requires Brackets Sprint 34 or newer (or Adobe Edge Code Preview 7 or newer).
1.0.5
3 years ago