Bug 20007 - [AST] Attribute completion is missing types
Summary: [AST] Attribute completion is missing types
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-05-23 07:25 UTC by Marek Safar
Modified: 2014-05-23 11:27 UTC (History)
4 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Marek Safar 2014-05-23 07:25:45 UTC
using System;

class G : Attribute
	public G (Type type)
		throw new ArgumentNullException ();

[G (typeof (A))] // A2 is missing from completion
class A2
	static void Main ()
Comment 1 Prashant manu 2014-05-23 10:09:49 UTC
We have checked with the above code snippet. While typing A we are getting A2 in completion window. Screencast: http://www.screencast.com/t/OweFoREbnX 

Please review this screencast and provide us the direction/suggestions so that we can check this issue at our end.

Environment Info:
Xamarin Studio Version 5.0 (build 876)
Git revision: 892675cba83be2d00954bfdf22dd8a29e6a47502
Xamarin addins: c62ebd0f0c296c5773c7b92ad06d5b5b487f40e8
Comment 2 Mike Krüger 2014-05-23 10:47:08 UTC
Should work in the 5.x branch.
Comment 3 Marek Safar 2014-05-23 11:13:49 UTC
Screencast from 5.1 branch

Comment 4 Mike Krüger 2014-05-23 11:21:37 UTC
Ah I see - it's missing in the parse tree.
Comment 5 Mike Krüger 2014-05-23 11:22:09 UTC
Test case:

using System;

class G : Attribute
    public G (Type type)
        throw new ArgumentNullException ();

[G (typeof (A
Comment 6 Marek Safar 2014-05-23 11:24:10 UTC
It's missing in valid (parsed) tree. I didn't try incomplete version
Comment 7 Mike Krüger 2014-05-23 11:24:46 UTC
I use some heuristics for the case while typing, but that fails sometimes in the ctrl+space cases.

But I don't  know if it makes sense to fix that bug - it's very special and it may be gone with roslyn.
Comment 8 Mike Krüger 2014-05-23 11:26:26 UTC
Invalid parse trees are the biggest problem when implementing code completion :/

It's required to have an incomplete parse tree in general. That's why we're switching to roslyn in the first place - and I wouldn't invest too much time in fixing the few mcs places right now.
Comment 9 Mike Krüger 2014-05-23 11:27:14 UTC
btw. completion works with parsing up to the caret - it's not built for parsing the whole file on key stroke ...

Note You need to log in before you can comment on or make changes to this bug.