Bug 20007 - [AST] Attribute completion is missing types
Summary: [AST] Attribute completion is missing types
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 20007 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

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 ...