Hi!
I'd like to use ESLint http://eslint.org inside Geany. I've seen many integrations with differents editors in their website. Are you aware of any current implementation for this lint or any similar? Do you think that it would be possible to integrate it with Geany (as a plugin of course)? How much effort would it need? And, the final question, which languages did Geany support to develop plugins again?
Greetings,
* Abel.*
Hi,
Le 10/08/2016 à 23:58, Abel a écrit :
Hi!
I'd like to use ESLint http://eslint.org inside Geany. I've seen many integrations with differents editors in their website. Are you aware of any current implementation for this lint or any similar? Do you think that it would be possible to integrate it with Geany (as a plugin of course)? How much effort would it need? And, the final question, which languages did Geany support to develop plugins again?
If it provides a command-line interface (which it seems), you likely can call it as a build command (see the manual). Using a linter as a build command is very easy: just configure the build command appropriately. There already are a few filtypes that come with a linter configured -- including JavaScript, using jshint -- so you can base yours on that.
Complexity for making it a plugin (so potentially getting more 'live' feedback) will highly depend on whether that thing has an API, and how it works. Also, for the moment you pretty much need to write Geany plugins in C or C++, although Thomas' Peasy plugin [1] adds support for several languages (include JS I'd believe), and it's getting closer to stability.
But no, I'm not aware of anyone having already written something with this eslint thing.
Cheers, Colomban
On 11 August 2016 at 00:06, Colomban Wendling lists.ban@herbesfolles.org wrote:
Hi,
Le 10/08/2016 à 23:58, Abel a écrit :
If it provides a command-line interface (which it seems), you likely can call it as a build command (see the manual). Using a linter as a build command is very easy: just configure the build command appropriately. There already are a few filtypes that come with a linter configured -- including JavaScript, using jshint -- so you can base yours on that.
Thank you! That's a good point to start from.
Complexity for making it a plugin (so potentially getting more 'live' feedback) will highly depend on whether that thing has an API, and how it works.
I previously received this answer from the eslint maling list:
If the editor can execute Node.js directly (like Atom or Visual Studio
Code), you can use Node.js API: http://eslint.org/docs/ developer-guide/nodejs-api Otherwise (like Sublime Text or Vim), maybe you can use CLI and communicate by stdio: http://eslint.org/docs/user-guide/command-line- interface
But if there are plugins for sublime or vim using CLI, it seems that the CLI way is not that bad. BTW, I forgot to link to the list of known editors integrations with ESLint: http://eslint.org/docs/user-guide/integrations#editors http://eslint.org/docs/user-guide/integrations#editors
Also, for the moment you pretty much need to write Geany plugins in C or C++, although Thomas' Peasy plugin [1] adds support for several languages (include JS I'd believe), and it's getting closer to stability.
What about Vala? it's getting closer to stability means that it'll be soon inside Geany trunk??
But no, I'm not aware of anyone having already written something with this eslint thing.
Cheers, Colomban
Thank you Colomban!!
[1] https://github.com/kugel-/peasy/ _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Le 11/08/2016 à 00:27, Abel a écrit :
[…]
If the editor can execute Node.js directly (like Atom or Visual Studio Code), you can use Node.js API: http://eslint.org/docs/developer-guide/nodejs-api <http://eslint.org/docs/developer-guide/nodejs-api>Otherwise (like Sublime Text or Vim), maybe you can use CLI and communicate by stdio: http://eslint.org/docs/user-guide/command-line-interface <http://eslint.org/docs/user-guide/command-line-interface>
But if there are plugins for sublime or vim using CLI, it seems that the CLI way is not that bad. BTW, I forgot to link to the list of known editors integrations with ESLint: http://eslint.org/docs/user-guide/integrations#editors http://eslint.org/docs/user-guide/integrations#editors
If you can communicate with the process yes, you could write a plugin doing so more dynamically than a build command. If the process can work with pipes even better. That's a Mere Matter of Programming, but it should not be *too* hard to do (Geany even has some supposedly handy API for communicating with a subprocess, taking care of the most obvious issues it implicates).
Also, for the moment you pretty much need to write Geany plugins in C or C++, although Thomas' Peasy plugin [1] adds support for several languages (include JS I'd believe), and it's getting closer to stability.
What about Vala?
Well, Vala requires a description of the C API too, but yes it can work. There is a manually generated VAPI file, but Thomas' work also generate a VAPI file automatically. That could probably be used.
it's getting closer to stability means that it'll be soon inside Geany trunk??
It's a plugin for Geany that adds support for extra plugins (it's actually a proxy for other plugins in other languages). I don't know when he'll consider it stable, but he certainly can answer. I think he considers it beta or close to that -- i.e. working, but would require wider testing.
Regards, Colomban
Am 11.08.2016 um 00:34 schrieb Colomban Wendling:
Also, for the moment you pretty much need to write Geany plugins in C or C++, although Thomas' Peasy plugin [1] adds support for several languages (include JS I'd believe), and it's getting closer to stability.
What about Vala?
Well, Vala requires a description of the C API too, but yes it can work. There is a manually generated VAPI file, but Thomas' work also generate a VAPI file automatically. That could probably be used.
Vala is fine. Peasy itself is written in Vala (at least partly). Peasy generates a .vapi for Geany's APIs and one for peasy's own APIs (there are very few of them at the moment). If you don't need peasy's APIs you can write the plugin such that it doesn't require peasy.
Other language options with peasy are whatever libpeas supports. This comprises python and lua at the moment. js was dropped by libpeas at some point. I haven't tested lua yet with peasy though.
I'd like to add ruby in the future but I don't know if I can manage.
it's getting closer to stability means that it'll be soon inside Geany trunk??
It's a plugin for Geany that adds support for extra plugins (it's actually a proxy for other plugins in other languages). I don't know when he'll consider it stable, but he certainly can answer. I think he considers it beta or close to that -- i.e. working, but would require wider testing.
Peasy is quite stable at this point and runs against Geany 1.28 without patches by now. I'm in the process of polishing the shipped plugins before I declare it stable.
Best regards.