atom-ide-hyperclick

Hyperclick UI

Tony Brix

259,139

9

1.0.11

GitHub

This package provides the following services:

This package consumes the following services:

Hyperclick

Pluggable text-clicking UI for Atom.

Hyperclick is triggered by two events:

Known Providers

Here are some existing providers for the Hyperclick package:

Demo

hyperclick-demo

Provider API

Example

Declare the provider callback in the package.json (e.g. getProvider).

"providedServices": {
  "hyperclick": {
    "versions": {
      "0.1.0": "getProvider"
    }
  }
}

NOTE: Providers for hyperclick.provider@0.0.0 are still accepted, but that naming is now deprecated. Please use hyperclick@0.1.0 for new providers.

Define the provider callback in lib/main.js.

export function getProvider() {
  return {
    priority: 1,
    grammarScopes: ["source.js"], // JavaScript files
    getSuggestionForWord(textEditor: TextEditor, text: string, range: Range): ?HyperclickSuggestion {
      return {
        // The range(s) to underline as a visual cue for clicking.
        range,
        // The function to call when the underlined text is clicked.
        callback() {},
      }
    },
  }
}

Details

You must define one of these methods on the provider:

The methods return a suggestion or a Promise that resolves to a suggestion:

Additional provider fields: