Tuesday, June 21, 2005

Quasi-working code completion

Quasi-working code completion. Posted by Hello

As you can tell from the screen-shot, its a bit broken because I'm dealing with scope issues - z shouldn't be in the complete word list, for example.

Also, typing with the list open is dog slow - I'm not sure why. It might be a flaw in my IScanner implementation. C# doesn't exhibit this, so its definitely wrecked on my end.

Another issue I have to deal with is sentinels -- they're currently a randomly generated GUID so they will not collide with any simiarily named elements in someone else's code. The tricky part is, Boo won't parse 'STRING LITERAL' as a string literal if it is not *exactly to the character* on the tab-space as the rest of the code.

I'm using sentinels in the AST because I cannot camp out the lexical information and wait for it to pass the line and column that was passed to me by Visual Studio. There's no "start" and "end" information available, so I don't want to jump the gun too early -- you know how that is.

To solve the issue of 'z' not being in scope, I'll have to temporarily "stop" the parser when I hit the sentinel, and traverse up the parent nodes until I'm out of any methods. I can't just hit the first ParentNode, because if the sentinel is in a closure, then there will be two methods - the closure, and the parent method of the closure. Yeah, that can be problematic, can't it? So I'll have to navigate upwards until I'm clear of all methods, and perhaps mark that node as the parent node instead of the way I am doing it now.

Well, my kinda-broken but kinda-not CompleteWord functionality was my feature for the day.

No comments: