Sublime Forum

Calling javascript in Sublime plugin

#1

I am working on a sublime plugin development , I have to invoke a javascript library form within the plugin, Can some one help me with sample code for it.

0 Likes

#2

Emmet does that with pyv8


https://code.google.com/archive/p/pyv8/


0 Likes

#3

It’s generally preferable not to do this unless you really need to. Integrating with JavaScript adds a lot of complexity, makes error handling more difficult, and potentially harms performance. There are a few cases where it still makes sense to do this; for example, there are packages that run JavaScript-based syntax analyzers that it would be unreasonable to port.

Emmet is an example of doing it very badly. It bundles an entire JavaScript runtime, but it uses it for basic text-editing functionality that could be accomplished just as well or better in Python. Emmet is a very common source of bugs; whenever completions aren’t working for someone, the first question is always whether they’ve installed Emmet, and uninstalling it often fixes the problem.

What JavaScript library do you want to invoke?

3 Likes

#4

Thanks ThomSmith. I was thinking of making a plug-in to integrate ethereum ide for solidity and providing in built EVM a run time for ethereum. Will it be doable?

0 Likes

#5

If you’re talking about the Remix IDE, it doesn’t look like it has any kind of real API. You’d probably be better off working from the underlying tools (e.g. solc). Rather than trying to bundle solc with your package, you should rely on end users to have solc installed.

0 Likes