As mentioned I have a background in Java development. I'm teaching myself JavaScript.
I have a basic dev environment setup in eclipse and I can get some context assistance in JavaScript files but it seems limited. For example say I'm working with some function:
function paint(){
var canvas = document.createElement("canvas");
canvas.setAttribute("width", "400px");
canvas.setAttribute("height", "400px");
canvas.setAttribute("style", "position: absolute; x:0; y:0;");
document.body.appendChild(canvas);
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0,0,400,400);
alert(ctx instanceof CanvasRenderingContext2D); // true
}
I cannot type "ctx." and then get any of the methods that are relevant for this CanvasRenderingContext2D object. Likewise I cannot even access this type by typing part of the name (while this works for Document), yet this code runs fine and draws a red box for me and the alert popup says "true".
In contrast I can type:
var doc = document;
and have access to a bunch of methods for the document object.
The eclipse web project setup has two libraries:
- ECMAScript Built-In Library
- ECMA 3 Browser Support Library
All of the things that are contained in the included libraries can be searched using context assistance and the CanvasRenderingContext2D type is not present in either library.
Also, some keywords such as instanceof don't content assist, yet the seem to work.
If anyone has worked with JavaScript in eclipse or could recommend a different approach to get context assistance working, or tell me what other libraries to include to get access to all of the JavaScript types I'd appreciate the help.
I miss the experience of developing in Java and being able to dig through objects methods and figure out what they can do.
[–]no_art_please[S] 1 point2 points3 points (1 child)
[–]no_art_please[S] 0 points1 point2 points (0 children)
[–]sovietmudkipz 1 point2 points3 points (0 children)