views:

119

answers:

2
a="hello";
b=a.sub();
document.write(b);

My eclipse won't code assist when I write this JavaScript code.

it's the sub() part. When I enter

b=a.s

and I press ctrl+space, it brings nothing. Why is that?

+1  A: 

Eclipse doesn't have enough information to provide code completion for JavaScript because JavaScript is an interpreted, dynamically typed language. It has no way of knowing what methods are valid for your a variable after you type that dot.

John Topley
It would have enough information for literals though (but still does not complete). It would be a nice feature. If I knew that I was working with a string or regexp or whatever, just type a quick literal ("" or // or ...) and have a handy reference. Then just delete the preceding chars and continue.
Keith Bentrup
A: 

Is there any tool that can code assist sub?

I heard in SO podcast that Steve Yegge is working at Google to do a tool for autocompletion for JavaScript
Ionel Bratianu
the soft name is SO podcast ?