IJavaScriptUnit for plugin development [message #1838162] |
Wed, 17 February 2021 16:26  |
Eclipse User |
|
|
|
B"H
Hi,
I have an old plugin that buildup of JS content fail since any version after mars2.
The basic problem is that no IType is recognized, so nothing get to build properly.
The JS code need not only for autocomplete but also to linked to from reference that exist in xml files.
I'm attach the code that use to work.
will be glad for any idea how I can make this code works again.
currently the top-level type array is simply empty
Thanks
private void fillCache(IJavaScriptUnit parent, String typeName,
Map<String, List<IMember>> cache) throws JavaScriptModelException {
IType type = parent.getType(typeName);
if (type != null && type.exists()) {
List<IMember> members = new ArrayList<IMember>();
cache.put(type.getFullyQualifiedName(), members);
IJavaScriptElement[] children = type.getChildren();
for (IJavaScriptElement scriptElement : children) {
if (!(scriptElement instanceof IMember)) {
continue;
}org.eclipse.wst.jsdt.core.
IMember member = (IMember) scriptElement;
if (!Flags.isStatic(member.getFlags())) {
if (member instanceof IFunction) {
if (!((IFunction) member).isConstructor()) {
members.add(member);
}
} else if (member instanceof IField) {
members.add(member);
fillCache(parent,
JSUtils.extractSignatureInfo(((IField) member)
.getTypeSignature()), cache);
}
}
}
}
}
|
|
|
Re: IJavaScriptUnit for plugin development [message #1838163 is a reply to message #1838162] |
Wed, 17 February 2021 17:31  |
Eclipse User |
|
|
|
JSDT was significantly changed with a new team after Mars.2, and after a series of reboots and incomplete technology
changes (which you seem to have run into), replaced with Wild Web Developer. You'd have to ask them for a replacement
API as JSDT is in maintenance mode and its UI significantly scaled back as a result.
|
|
|
Powered by
FUDForum. Page generated in 0.09045 seconds