Eclipse Javascript Plugin extension - javascript

I am new to creating plugins. I want to create an eclipse plugin for a new scripting language. And, its syntax is quite similar to JavaScript. So, I wish to extend existing Javascript plugin that exists in eclipse.
Please suggest how do I go about it. Mainly, I want to have editor functionality (syntax checking, auto completion and ctrl-click to go to hop across functions), no compiler/build is needed.
Also, where do I find the source code for existing JavaScript plugin.

The source of the JavaScript editor can be found in the http://download.eclipse.org/webtools/repository/kepler/ repository (assuming Eclipse Kepler). Look for the JavaScript Development Tools SDK.
You install this in to Eclipse using Help > Install New Software and the source is then available to read using Navigate > Open Type (you need to have Include all plug-ins from target in Java search selected in Preferences > Plug-in Development for this).
Eclipse editor code is very complex and it likely to be hard work to adapt it. You might find it easier to use something like Eclipse xText which is designed for developing support for new languages.

Related

Robust Visual HTML Editor to JavaScript app

I'm searching for robust HTML Visual Editor solution, which is implementable to Meteor javascript project. Paid or free/open-source, it's not depend, but 'easy' implementable, stable, safe, splitted to desing modules, etc.
I'm searching for Visual Editor, something like Elementor https://elementor.com/,
(not only simple WYSIWYG editor like CKEditor, TinyMCE or etc) but implementable to own meteor app.
...especially, I prefer, If you have own developer/designer positive experience with concrete Visual Editor solution implemented to own JavaScript app.
...and ideally, if editor is available on npm.
Thanks a lot for each answer, idea or experience.
You can look at codemirror, or ace, both of which will give you the ability to edit js with syntax highlighting, If you want to have advanced IDE capability (as you seem to want), then it's a whole bunch more work.
This is an example of simple code editor (for Markdown files) https://example-ide.meteorfarm.com/
Petar Karpaonic has done some good work with Meteor Kitchen, you might look around at his site for some inspiration.

How could I script in Javascript (preferably) the eclipse command: Import/Check out Maven Projects from SCM using eclipse ease

I looked and I cannot find out how to do this. Eclipse does this using wizards and job and quite honestly, it is way too complicated to understand easily. Any example would be much appreciated. I do not want to have to write a plugin to do this and please do not ask me to do this in groovy or some other language unless it is impossible in Javascript.
By the way, the EASE support page says to create the question using the ease tag but since it does not exist and since I do not have enough points I cannot create it.
EASE provides support for checkout/import up to some degree.
Option 1:
Use the /System/Git scripting module for git checkouts:
loadModule("/System/Git");
clone("https://github.com/Pontesegger/codeandme.git", "C:\\test");
importProject("C:\\test\\ui\\TableViewer DnD Sorting");
The module /System/SVN provides similar functionality for SVN repositories.
Option 2:
Use an existing EGit/Subversive/... command. The /System/Platform module allows to execute any registered eclipse command:
loadModule("/System/Platform");
executeCommand("eclipse.project.command.id")
This could be used to mimic clicks in the UI as any toolbar button/menu entry in eclipse triggers a command. The Eclipse Plugin-spy might help in detecting command ids.

Guide for extending the Javascript language on VsCode for a 3rd party API

So I've started using VsCode over Atom recently and love it, the issue is I develop for software that uses its own JS API with no proper integration into anything.
I've started trying to implement my own autocomplete/intellisense structure using their pdf into VsCode to speed up my workflow, currently I'm simply using a JS file that is full of empty functions and objects with a bunch of JSDoc comments to help VsCode Intellisense identify what's what, that seems to be working fine so far but it means importing this "useless" file into every project I work on.
I looked into extending the JS language using a language server but that seems way too complex for what I need (plus it looks like I'd be building the entire Javascript language from scratch).
Does anyone have any recommendations ect?
Kind regards.
Edit
Sorry I also would like the ability for it to pass linting as right now it gets a bit funky with it.
You likely do not need an extension for that your example use case.
VS Code's intellisense for libraries is powered by .d.ts typing declaration files. The declaration files for the library you are using can either be written in your current workspace as you are currently doing, or—preferably—shipped with the library itself. Many npm modules ship their with typing definitions files, while other libraries have typing definition files provided by the community through DefinitelyTyped.
You alternatively bundle d.ts types file into as a separate npm package that you include in any project that needs them

Netbeans 8.0.2's Syntax Highlight and Code Folding not working for PHP, HTML, Javascript

I am using ubuntu 15.10 and used ubuntu software center for netbean's installation. So, here is the list of not working functionality which I noticed.
In html files, it show red color when select tags, no code folding, enter button is not working for lines and no code completion.
In Javascript files, it show plain-text only.
In Php files, only code folding is not working.
I know how to disable or enable syntax. I have also answered a question here.
I think it is because a plugin is not installed. If so, I really don't know which plugins I should install for php developement.
EDIT
One more thing I want to show you my installed plugins are shown in the below image
Please help me with Answers/Suggestions. Thanks in Advance.
Netbeans was primarily developed as Java programming IDE. So all functionality for programming languages other than Java is not hardcoded into Netbeans internal functionality but can be ensured by external plugins.
It seems that Ubuntu software center contains general Netbeans bundle that can work with Java but lacks PHP plugins (and perhaps highlights some PHP syntax because of its similarity to Java syntax).
You can find out what plugins you need and install them, but more convenient solution is to download and install from official site PHP Netbeans bundle which includes all functionality for PHP Web-development including PHP, HTML and JavaScript syntax highlightning and code folding.

How do you attach JSdoc in Eclipse so that I can have autocomplete for a personal library

I have a JavaScript library that I am working on currently. I have structured it into lots of files and I use the module approach to define each 'module'.
var ns = generateNamespace("me.mycompany.mypackage.MyFile");
(function (ns, undefined) {
// some module
}(ns));
The modules are dynamically named using a namespacing function meaning that autocomplete is almost impossible as things stand (unless Eclipse can run my code and figure out the namespaces, Visual Studio can!).
Therefore I intend to generate JSdoc for my project in the hope that if I include this into Eclipse (somehow) Eclipse can use this to give me content assist.
Firstly I do not know if this is possible... however I think that it is as I can see that it is maybe how this works? However I tried to follow this along and struggled to get something working, by this I mean it didn't work. The interesting info from the link:
"JSDT libraries are collections of JavaScript source files that have prototyped object/class definitions and JSDoc. The inference engine then models these libraries... making them available to every JavaScript file in the project... Bindings for nonstandard and future runtimes are similarly easy to create... add the... library to their project and gain content completion and hover help"
I know how to write JSdoc annotations and I know how to generate JSdoc using one of the various tools.
What I need therefore is instructions on how to include JSdoc (as a library maybe) in Eclipse so that it will give auto complete for the stuff in the JSdoc.
Previous answer:
You can also run jsdoc_toolkit from within eclipse by setting up Run -
> External Tools -> Open External Tools Dialog...
Location
C:\Program Files\Java\jre1.5.0_12\bin\java.exe
Working Directory
C:\DirectoryToWhereJsDocToolkitIsLocated\jsdoc_toolkit
Arguments
-jar app/js.jar app/run.js -r=4 -t=templates/htm "-d=C:
\PathToWhereDocIsSaved" "C:\PathToWebsiteToDocument"
For more about the arguments check the jsdoc_toolkit documentation.
Have fun
Simon
Taken from this Google Groups thread.
Updated Answer:
Eclipse JavaScript Editor: content assist for js files, autocompletion
Disclaimer, I'm the author of tern.java.
I suggest you that you install tern.java. It provides a JSDoc support. Once you have selected this support, you can benefit
with completion :
and soon with validation:
This support is not perfect but it starts working.
I am not using it by myself, so I'm not sure if it works, but there exists a grunt-plugin for jsdoc3. Grunt is supported by Eclipse. So maybe it helps.
Grunt-PlugIn in npm

Categories

Resources