Bug 205569

Summary: DOMResolver patch (also accept scriptables instead of just ScriptableObject)
Product: [Technology] DLTK Reporter: Johan Compagner <jcompagner>
Component: CommonAssignee: Andrei Sobolev <andrei.sobolev>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andrei.sobolev, andrey
Version: 0.95Keywords: contributed
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
dom resolver patch
alex.panchenko: iplog+
dom resolver patch2 (and code completion null pointer) alex.panchenko: iplog+

Description Johan Compagner CLA 2007-10-05 09:34:13 EDT
Created attachment 79802 [details]
dom resolver patch

The dom resolver only works with ScriptableObject as scopes. But the problem is we don't have those a lot. Or scopes are most implemented by our self and are just an implementation of the Scriptable interface.

I changed it so that it takes Scriptable interface and if it is a ScriptableObject it will still do getAllIds() if it isn't so just an other implementation of Scriptable then i call getIds().

I do have an extra false: in that 

if(resolveTopLevelScope instanceof ScriptableObject && false)


because if we do getAllIds() then we do get a lot of garbage that we don't want. (also all the NON_ENUM properties..) 
So if we still want to have support for that, Can the IDesignTimeDOMProvider then be changed with one extra method? Something like:

public List filterList(List proposols);

So that an IDesingTimeDOMProvider can filter stuff from the list that they don't want to show?
Comment 1 Andrei Sobolev CLA 2007-10-16 08:26:14 EDT
Applied.
Comment 2 Johan Compagner CLA 2007-10-16 09:24:40 EDT
Created attachment 80444 [details]
dom resolver patch2 (and code completion null pointer)

This is another patch for the dom resolver part for code completion.
I need to return 2 DomResolvers, the big one (the top level scope) is an ScriptableObject but the small one (thats the current context, i do miss that notion a bit) Is just a Scriptable. Again the same thing applies its better to just aks for the interface Scriptable then on a  concrete class.

This also holds an null pointer fix for the src/org/eclipse/dltk/ui/text/completion/CompletionProposalComparator.java
Because the getSortString() did return null for many of the proposels.
Because it is possible to have an  AbstractScriptCompletionProposal that doesnt'have the sortstring initialized. I just fall back then to the display string.
Comment 3 Andrey Platov CLA 2008-04-01 04:01:23 EDT
Please take care of this
Comment 4 Andrei Sobolev CLA 2008-04-01 04:19:07 EDT
Patch applied.
Comment 5 Andrey Platov CLA 2008-05-26 02:48:47 EDT
bulk change: fixed in 0.95