Git Product home page Git Product logo

Comments (3)

trotzig avatar trotzig commented on May 21, 2024

To create a plugin, there are a few options. The best thing is if the editor already supports plugins written in Ruby. Then you can directly instantiate a ImportJS::Importer with a custom editor class (e.g. ImportJS::WebStormEditor). Look at ImportJS::VIMEditor for inspiration.

If the plugin framework doesn't allow Ruby plugins, then you can do what the Sublime plugin does: use the external import-js command-line tool (available after installing the import_js gem, notice differences in dash and underscore between gem and CLI tool - that's unfortunate but intentional). The CLI tool accepts file contents via stdin, and outputs the whole file again (after doing imports) in stdout. In case there are messages to display, or ambiguities to resolve, stderr contains a JSON blob with useful information. See https://github.com/trotzig/import-js/blob/master/import-js.py for how the Sublime plugin is implemented.

The Emacs plugin uses a slightly different approach. It keeps a running Ruby process and passes messages back and forth. See https://github.com/trotzig/import-js/blob/master/plugin/import-js.el .

I'll be happy to provide continued support for whoever makes an attempt at creating a plugin.

from import-js.

mikabytes avatar mikabytes commented on May 21, 2024

Is this still relevant? @trotzig @lencioni

from import-js.

lencioni avatar lencioni commented on May 21, 2024

I think we can close this out.

from import-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.