diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/addins/AspNet/Commands/AddViewDialog.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/addins/AspNet/Commands/AddViewDialog.cs')
-rw-r--r-- | main/src/addins/AspNet/Commands/AddViewDialog.cs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/main/src/addins/AspNet/Commands/AddViewDialog.cs b/main/src/addins/AspNet/Commands/AddViewDialog.cs index 752fc51522..8525483503 100644 --- a/main/src/addins/AspNet/Commands/AddViewDialog.cs +++ b/main/src/addins/AspNet/Commands/AddViewDialog.cs @@ -29,15 +29,17 @@ using System.IO; using System.Collections.Generic; using PP = System.IO.Path; -using MonoDevelop.Ide; +using Gtk; +using ICSharpCode.NRefactory6.CSharp; +using Microsoft.CodeAnalysis; using MonoDevelop.Core; -using ICSharpCode.NRefactory.TypeSystem; +using MonoDevelop.Ide; using MonoDevelop.Ide.TypeSystem; using MonoDevelop.AspNet.Projects; -using MonoDevelop.AspNet.WebForms.Dom; using MonoDevelop.AspNet.WebForms; using Gtk; using MonoDevelop.Projects; +using MonoDevelop.AspNet.WebForms.Dom; namespace MonoDevelop.AspNet.Commands { @@ -366,7 +368,7 @@ namespace MonoDevelop.AspNet.Commands if (!File.Exists (realPath)) return; - var pd = TypeSystemService.ParseFile (project, realPath) as WebFormsParsedDocument; + var pd = TypeSystemService.ParseFile (project, realPath).Result as WebFormsParsedDocument; if (pd != null) { try { @@ -470,22 +472,18 @@ namespace MonoDevelop.AspNet.Commands class TypeDataProvider
{
- public List<ITypeDefinition> TypesList { get; private set; }
+ public List<INamedTypeSymbol> TypesList { get; private set; }
public List<string> TypeNamesList { get; private set; }
- Ambience ambience;
public TypeDataProvider (MonoDevelop.Projects.DotNetProject project)
{
- TypeNamesList = new List<string> ();
- var ctx = TypeSystemService.GetCompilation (project);
- TypesList = new List<ITypeDefinition> (ctx.MainAssembly.GetAllTypeDefinitions ());
- this.ambience = AmbienceService.GetAmbience (project.LanguageName);
+ TypeNamesList = new List<string> (); + var ctx = TypeSystemService.GetCompilationAsync (project).Result; + TypesList = new List<INamedTypeSymbol> (ctx.GetAllTypesInMainAssembly ());
foreach (var typeDef in TypesList) {
- TypeNamesList.Add (ambience.GetString ((IEntity)typeDef, OutputFlags.IncludeGenerics | OutputFlags.UseFullName | OutputFlags.IncludeMarkup));
+ TypeNamesList.Add (Ambience.EscapeText (typeDef.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat))); }
}
} } } - - |