Bug 205569 - DOMResolver patch (also accept scriptables instead of just ScriptableObject)
Summary: DOMResolver patch (also accept scriptables instead of just ScriptableObject)
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 0.95   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andrei Sobolev CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-10-05 09:34 EDT by Johan Compagner CLA
Modified: 2010-06-11 07:07 EDT (History)
2 users (show)

See Also:


Attachments
dom resolver patch (1.86 KB, patch)
2007-10-05 09:34 EDT, Johan Compagner CLA
alex.panchenko: iplog+
Details | Diff
dom resolver patch2 (and code completion null pointer) (3.12 KB, patch)
2007-10-16 09:24 EDT, Johan Compagner CLA
alex.panchenko: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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