Bug 2542 - Mono.CSharp.Evaluators.GetCompletions() doesn't return extension methods
Summary: Mono.CSharp.Evaluators.GetCompletions() doesn't return extension methods
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2011-12-16 14:16 UTC by Patrick Smacchia
Modified: 2015-11-06 10:25 UTC (History)
2 users (show)

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


Attachments
The extension method Where() should be matched (209.53 KB, image/jpeg)
2011-12-16 14:16 UTC, Patrick Smacchia
Details

Description Patrick Smacchia 2011-12-16 14:16:22 UTC
Created attachment 1060 [details]
The extension method Where() should be matched

I use the most recent Mono.CSharp downloaded today 16th of December 2011 from Github.

See the 2 screenshots attached.
In the left one the extension method Where<T>(this IEnumerable<T> ) should be matched by GetCompletions().
The right screenshot proves that the evaluator context knows the method Where(), since it recognizes that i is an integer.

On a side note, could it be possible to get a GetCompletions() method that would returns something more precises than just strings, like members or types metadatatokens + their parent assemblies for example?

Btw, congrat for this awesome piece of code :)

----------------------------------------------------------
The source code:

using System;
using Mono.CSharp;
namespace ConsoleApplication1 {
   class Program {
      static void Main(string[] args) {
         var report = new Report(new ConsoleReportPrinter());
         var cmd = new CommandLineParser(report);

         var settings = cmd.ParseArguments(args);
         if (settings == null || report.Errors > 0) { Environment.Exit(1); }

         var evaluator = new Evaluator(settings, report);

         //evaluator.LoadAssembly("System.Core");
         evaluator.Run("using System.Linq;");
         evaluator.Run("using System.Collections.Generic;");
         evaluator.Run("IEnumerable<int> Ints;");
         string prefix;
         var propositions = evaluator.GetCompletions(@"Ints.Whe", out prefix);

      }
   }
}

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