Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] some questions about ast/code completion

Hi,
 
 
Now we have a formatter in js, we also have a AST tree that is being build up to format right?
So that one is now describing the js file but we also have the HostCollection with its IReference tree/graph structure.
 
Arent those 2 doing a bit of the same thing? (except that the format ast does it in much more detail and maybe not the variables and calls methods as references to each other)
But shouldnt we try to merge the 2 that we have 1 thing? that does both? or is this just a bit to easy thinking ofmy side? :)
 
why i come to this is because of this
 
var NAV = new navigationObject();
function navigationObject() {
 this.history = {
  back: function(){}, //FIXME: put the cursor between the curly brackets and press enter: extra bracket gets inserted, wrong formatting and indentation
  forward: function(){}
 };
 this.show = function show2(programName){
 }
}
function test() {
 NAV.[CTRL-SPACE]
}
 
 
there you see a functionObject being create (NAV) that has variable (history which is a function object again) and  function/method show(programName)
 
now   that "programName" is what i am talking about here.
Because in the outline i do see show(programName) just nicely
 
But if i later code complete so
 
NAV.[CTRL-SPACE]
 
then i do get history as a field and show as a method. But show doesnt show me the param.
 
I digged a bit in it and the field show has  new reference to that results again in a TransparanetResolver that has a ContextReference on its turn
has the HostCollection that describes the show2 function.
 
That HostCollection has some references like itself: show2=show2, returnValue=returnValue and also programName=programName
But it doesnt really tell me what the params are. It are just all the same kind of stuff..
 
so later on when i am trying the make CompletionProposals of a TransparantRef then i know only that it is a functionRef (ContextReference does return true for that)
but how should i get the params? I know it is one of them 3 levels deel (transparantref->contextref->hostcollection)
But still i dont really know which i can ignore and which are correct.
 
for example everything changes if i just add another this.xxx inside show again...:
 
var NAV = new navigationObject();
function navigationObject() {
 this.history = {
  back: function(){}, //FIXME: put the cursor between the curly brackets and press enter: extra bracket gets inserted, wrong formatting and indentation
  forward: function(){}
 };
 this.show = function show2(programName){
   this.x = "test";
 }
}
function test() {
 NAV.[CTRL-SPACE]
}
 
any idea's how to improve this?
 
 

Back to the top