Code completion not really working at all #161

Closed
MartinIsHot opened this Issue Oct 27, 2012 · 17 comments

Comments

Projects
None yet
2 participants

It seems that my auto completion isn't working properly. Sometimes it works fine, most of the times doesn't work though.

I don't really know how to explain it, but whenever the code completion window pops up, it only shows the standard functions like .alignof, .init, .mangleof, etc.

An example:
Object obj;
obj. <--- Code completion only shows .alignof, .mangleof, .init, etc. here, not members like .opCmp, .opEquals, .toHash, etc.

A video showing the bug can be found here: http://www.youtube.com/watch?v=0Suey6IcLyk

Note: If I don't include the phobos runtime and druntime (In MonoDevelop, Options -> Other -> D -> Compiler toolchains -> Includes), however, it works just fine.

Owner

aBothe commented Oct 27, 2012

Which mono-d version? The one (v0.4.1.7) I uploaded yesterday? If not, please update - yeah, it's sometimes annoying, but as I tested it lastly on both ubuntu/win with MD 3.0.5 it worked flawlessly :)

Yes, I am indeed using the newest (0.4.1.7) version of Mono-D. I tried re-installing both MonoDevelop and the Mono-D addin, nothing changed. I'm using MonoDevelop 3.0.4.7 on Windows though.

Owner

aBothe commented Oct 27, 2012

Is this happening only at the end of a source file? Or also in the middle?

It happens anywhere, top, bottom, middle, left, right. Sometimes, if I keep restarting MonoDevelop, it just magically works though. Like 1/10 times, I guess.

Owner

aBothe commented Oct 27, 2012

What the.. yepp, I guess that must be magic..okay now it happens over here either :/

In the mean time I recommend you to pick a previous version: http://mono-d.alexanderbothe.com/repo

Owner

aBothe commented Oct 27, 2012

Wait..in 3.0.5 it works..that is awful

[Edit] And in 3.0.4.7 it start's to work too.. that must be tragic magic and probably only happens due to false caching or something..

Hm, I just tried the three other Mono-D versions from the repository you posted, they seem to have the same issue with MonoDevelop 3.0.4.7. Perhaps I should try another version of MonoDevelop

Yeah, it works sometimes here too. Works 100% of the time if I just don't include phobos and druntime, which backs up what you're saying

Owner

aBothe commented Oct 27, 2012

I'm debugging this undefined stuff now..

Owner

aBothe commented Oct 27, 2012

no..simply..no...not A FU*ING DU_B ERROR LIKE THIS...it's not even a really hard one..it's just...stupidity..I'll provide an update in a couple of minutes ><

Hahahahahaha, awesome! Love your work :D

Owner

aBothe commented Oct 27, 2012

It's been a legacy bug then..It was a manual stack overflow prevention, but the stack counter variable has not been declared object-wide but statically..so it's been just a question of coincidence when 5 or more type resolutions are done parallel (e.g. at startup, when pre-resolving the arguments for ufcs completion) - and well, here we go.. I'll just make some final tests :)

Edit: Haha, there actually IS an overflow..so then I guess it's exactly what this sub-feature was made for..WOOHOO, even more debugging and deeper-digging.
Anyway thanks for letting me get the idea to attach the debugger to the running MD 3.0.4.7 executable ;)

Alright, well I'm glad you found the bug. And so fast, too. I've really been frustrated with it since I thought it was my computer that was messing up

Owner

aBothe commented Oct 27, 2012

It's a deeper-situated issue - there's something wrong with deducing template parameters or something..and now I've got to figure out what is broken there

Owner

aBothe commented Oct 27, 2012

template ExtractedBoundArgs(BoundArgs ...) {
        static if (BoundArgs.length == 0) {
                alias Tuple!() ExtractedBoundArgs;
        }

        // we'll store all non-dynamic arguments...
        else static if (!isDynArg!(BoundArgs[0])) {
                alias ExtractedBoundArgs!(BoundArgs[1..$]).meta.prependT!(BoundArgs[0]) ExtractedBoundArgs;
        }

        // ... and we're going to leave the dynamic ones for later
        else {
                alias ExtractedBoundArgs!(BoundArgs[1..$]) ExtractedBoundArgs;
        }
}

Now assume what's "broken"..there's nothing really broken but "not implemented yet"..the declaration conditions..I'll re-enable this SO prevention again, but now with a little more intelligent behaviour + a link to this issue and this piece of code (can be found in D1's std.bind module, line 882) ;)

Owner

aBothe commented Oct 27, 2012

Okay, I've (temporarily) fixed it. Just install the latest version again and tell me whether it works :)

Yes! It works perfectly now

@aBothe aBothe closed this Oct 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment