~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
                                var parsedDocument = Document.ParsedDocument;
113
113
                                if (parsedDocument == null)
114
114
                                        return null;
115
 
                                var unit = parsedDocument.GetAst<CompilationUnit> ().Clone ();
116
 
                                var file = parsedDocument.ParsedFile as CSharpParsedFile;
 
115
                                var unit = parsedDocument.GetAst<SyntaxTree> ().Clone ();
 
116
                                var file = parsedDocument.ParsedFile as CSharpUnresolvedFile;
117
117
                                
118
118
                                var resolvedNode = unit.GetNodeAt<BlockStatement> (Document.Editor.Caret.Location);
119
119
                                if (resolvedNode == null)
135
135
                
136
136
                public AstType CreateShortType (IType fullType)
137
137
                {
138
 
                        var parsedFile = Document.ParsedDocument.ParsedFile as CSharpParsedFile;
 
138
                        var parsedFile = Document.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
139
139
                        
140
140
                        var csResolver = parsedFile.GetResolver (Document.Compilation, Document.Editor.Caret.Location);
141
141
                        
158
158
                                Document = document
159
159
                        };
160
160
                        if (document.ParsedDocument != null && document.ParsedDocument.ParsedFile != null) {
161
 
                                var ctx = document.ParsedDocument.GetTypeResolveContext (document.Compilation, document.Editor.Caret.Location);
162
161
                                options.EnclosingPart = document.ParsedDocument.ParsedFile.GetInnermostTypeDefinition (document.Editor.Caret.Location);
163
162
                                if (options.EnclosingPart != null)
164
 
                                        options.EnclosingType = options.EnclosingPart.Resolve (ctx).GetDefinition ();
 
163
                                        options.EnclosingType = options.EnclosingPart.Resolve (document.Project).GetDefinition ();
165
164
                                if (options.EnclosingType != null) {
166
165
                                        options.EnclosingMember = options.EnclosingType.Members.FirstOrDefault (m => !m.IsSynthetic && m.Region.FileName == document.FileName && m.Region.IsInside (document.Editor.Caret.Location));
167
166
                                }