A javascript library for connecting editors to Optic
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.babelrc
.gitignore
.npmignore
LICENSE
Readme.md
package-lock.json
package.json

Readme.md

Optic Editor SDK

A nice utility for building Optic IDE plugins

Usage

npm install optic-editor-sdk

Editor Actions:

  • Search -> detect and push an inline search to Optic
import {EditorConnection} from 'optic-editor-sdk'

EditorConnection.actions.search(file, start, end, 'query string')

To detect if an inline search has been input use the following utility:

import {checkForSearch} from 'optic-editor-sdk'
checkForSearch('line contents', startInLine, endInline)
  • Push Context -> push the current state of your editor to Optic
import {EditorConnection} from 'optic-editor-sdk'

EditorConnection.actions.context(file, start, end, 'file contents')