ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Clickable​Requires

by hajnalben ST3

Open the required javascript files with a mouseclick in SublimeText3

Details

Installs

  • Total 131
  • Win 54
  • OS X 60
  • Linux 17
Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11
Windows 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 1 0 0 0 0 0 3 0 0 0 0 0 0 0
OS X 2 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

ClickableRequires for Sublime Text 3

Description

Open the required javascript files with a mouseclick as you are doing it in another IDEs. The implementation of the file search is based on the specification of require function in Node.js.

https://nodejs.org/api/modules.html#modules_all_together

:sunglasses: Now ES6 import statements are supported as well. :sunglasses:

Installation

  • clone the repository into Sublime Packages folder
  • install through Package Control: ClickableRequires

Usage

You can hover on any require('module-name') or import module from 'module' statements to open a pop-up with in-app link to the file. For core node modules the online documentation will be opened in the browser. If the file is from node_modules then also an npm link to the package will be displayed.

Click settings

You can setup the plugin to navigate on mouseclick: * open the Pakages by Command Palette -> Browse Packages * in /Packages/User/ folder create or edit the Default.sublime-mousemap file * add the following (here you can modify the button and the modifiers as you like but beware with binding collosions.):

[
  { "button": "button1", "modifiers": ["super"], "command": "open_require_under_cursor", "press_command": "drag_select" }
]

demo

Settings

The default settings are the following:

{
  "debug": false,                 // To turn on or off file searching debug logs
  "reveal_in_side_bar": true,     // Will reveal the file in the sidebar
  "extensions": [".js", ".jsx"],  // The file extensions the plugin searches in
  "scope": "support.module",      // See more at https://www.sublimetext.com/docs/3/scope_naming.html
  "icon": "dot",                  // Possible values: dot, circle, bookmark and cross. Empty string for hidden icon.
  "underline": true,              // If the module names should be underlined
  "show_popup_on_hover": true,     // If a popup with module link and path should appear on hovering the require statement
  "auto_fold_imports": false      // Fold lines with import when opening file
}

However you can override them in Preferences -> Package Settings -> ClickableRequires -> Settings - User.

Webpack or other module handlers

If you are using webpack resolve.modules or resolve.aliases then you should configure the routes to this modules in your .sublime-project file. Use relative paths to the project file!

{
  "folders":
  [
    {
      "path": "."
    }
  ],
  "settings":
  {
     "webpack_resolve_modules": ["src", "other_module_directory"],
     "webpack_resolve_extensions": [".js", ".jsx", ".json"]
  }
}