diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-07-22 18:20:39 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-07-22 18:20:39 +0400 |
commit | 8ba55e9459ba7fc6128483300bdd3faf5f03ae5c (patch) | |
tree | c1833a478e88f182a57d80e2a4165e3ad066f8bd /main | |
parent | 0ec0b40ddffa851ea4ebeedba616d5246967bd53 (diff) |
Fixed 'Bug 27 - Parser errors in C# binding' (resolve error)
Diffstat (limited to 'main')
2 files changed, 6 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs index 70e7f0a99b..d5260a6bbe 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs @@ -296,7 +296,7 @@ namespace MonoDevelop.Projects.Dom.Serialization } } } else { - DomCecilCompilationUnit ainfo = DomCecilCompilationUnit.Load (fileName, false, true); + DomCecilCompilationUnit ainfo = DomCecilCompilationUnit.Load (fileName, false, true, false); UpdateTypeInformation (ainfo.Types, ainfo.Attributes, fileName); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomCecilCompilationUnit.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomCecilCompilationUnit.cs index aec2c0de92..e39614c424 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomCecilCompilationUnit.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomCecilCompilationUnit.cs @@ -91,10 +91,11 @@ namespace MonoDevelop.Projects.Dom } } - public static AssemblyDefinition ReadAssembly (string fileName) + public static AssemblyDefinition ReadAssembly (string fileName, bool useCustomResolver = true) { ReaderParameters parameters = new ReaderParameters (); - parameters.AssemblyResolver = new SimpleAssemblyResolver (Path.GetDirectoryName (fileName)); + if (useCustomResolver) + parameters.AssemblyResolver = new SimpleAssemblyResolver (Path.GetDirectoryName (fileName)); using (var stream = new MemoryStream (File.ReadAllBytes (fileName))) { return AssemblyDefinition.ReadAssembly (stream, parameters); } @@ -116,11 +117,11 @@ namespace MonoDevelop.Projects.Dom } */ - public static DomCecilCompilationUnit Load (string fileName, bool loadInternals, bool instantiateTypeParameter) + public static DomCecilCompilationUnit Load (string fileName, bool loadInternals, bool instantiateTypeParameter, bool customResolver = true) { if (String.IsNullOrEmpty (fileName)) return null; - DomCecilCompilationUnit result = new DomCecilCompilationUnit (ReadAssembly (fileName), loadInternals, instantiateTypeParameter); + DomCecilCompilationUnit result = new DomCecilCompilationUnit (ReadAssembly (fileName, customResolver), loadInternals, instantiateTypeParameter); result.fileName = fileName; return result; } |