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

« back to all changes in this revision

Viewing changes to src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/DocumentReferenceManager.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:
34
34
using System.Globalization;
35
35
 
36
36
using MonoDevelop.Core;
37
 
using MonoDevelop.AspNet.Parser.Dom;
 
37
//using MonoDevelop.AspNet.Parser.Dom;
38
38
using MonoDevelop.Projects.Text;
39
39
using MonoDevelop.Ide.CodeCompletion;
40
40
using MonoDevelop.Ide.Gui;
43
43
using Mono.TextEditor;
44
44
using ICSharpCode.NRefactory.TypeSystem;
45
45
using MonoDevelop.Ide.TypeSystem;
 
46
using MonoDevelop.Xml.StateEngine;
 
47
using MonoDevelop.AspNet.StateEngine;
46
48
 
47
49
namespace MonoDevelop.AspNet.Parser
48
50
{
149
151
                
150
152
                public IEnumerable<CompletionData> GetControlCompletionData ()
151
153
                {
152
 
                        return GetControlCompletionData (TypeSystemService.GetCompilation (Project).LookupType ("System.Web.UI", "Control"));
 
154
                        return GetControlCompletionData (ReflectionHelper.ParseReflectionName ("System.Web.UI.Control").Resolve (TypeSystemService.GetCompilation (Project)));
153
155
                }
154
156
                
155
157
                public IEnumerable<CompletionData> GetControlCompletionData (IType baseType)
209
211
                                
210
212
                                AssemblyRegisterDirective ard = rd as AssemblyRegisterDirective;
211
213
                                if (ard != null) {
212
 
                                        string assembly = ard.Assembly;
213
214
                                        var dom = TypeCtx.ResolveAssembly (ard.Assembly);
214
215
                                        if (dom == null)
215
216
                                                continue;
363
364
                        
364
365
                        Doc.Info.RegisteredTags.Add (directive);
365
366
                        
366
 
                        var line = Math.Max (node.Location.EndLine, node.Location.BeginLine);
 
367
                        var line = Math.Max (node.Region.EndLine, node.Region.BeginLine);
367
368
                        var pos = editor.Document.LocationToOffset (line, editor.Document.GetLine (line - 1).Length);
368
369
                        if (pos < 0)
369
370
                                return;
378
379
                        }
379
380
                }
380
381
                
381
 
                DirectiveNode GetRegisterInsertionPointNode ()
382
 
                {
383
 
                        var v = new RegisterDirectiveInsertionPointVisitor ();
384
 
                        Doc.RootNode.AcceptVisit (v);
385
 
                        return v.Node;
386
 
                }
387
 
                
388
 
                class RegisterDirectiveInsertionPointVisitor: Visitor
389
 
                {
390
 
                        public DirectiveNode Node { get; private set; }
391
 
                        
392
 
                        public override void Visit (DirectiveNode node)
393
 
                        {
394
 
                                switch (node.Name.ToLowerInvariant ()) {
395
 
                                case "page": case "control": case "master": case "register":
396
 
                                        Node = node;
397
 
                                        return;
 
382
                AspNetDirective GetRegisterInsertionPointNode ()
 
383
                {
 
384
                        foreach (XNode node in Doc.XDocument.AllDescendentNodes) {
 
385
                                if (node is AspNetDirective) {
 
386
                                        AspNetDirective directive = node as AspNetDirective;
 
387
                                        
 
388
                                        switch (directive.Name.Name.ToLower ()) {
 
389
                                        case "page":
 
390
                                        case "control":
 
391
                                        case "master":
 
392
                                        case "register":
 
393
                                                return directive;
 
394
                                        }
 
395
                                } else if (node is XElement) {
 
396
                                        return null;
398
397
                                }
399
398
                        }
400
 
                        
401
 
                        public override void Visit (TagNode node)
402
 
                        {
403
 
                                QuickExit = true;
404
 
                        }
 
399
                        return null;
405
400
                }
406
401
                
407
402
                #endregion
446
441
                public override string Description {
447
442
                        get { 
448
443
                                if (base.Description == null && cls != null)
449
 
                                        base.Description = AmbienceService.GetDocumentationSummary (cls.GetDefinition ());
 
444
                                        base.Description = AmbienceService.GetSummaryMarkup (cls.GetDefinition ());
450
445
                                return base.Description;
451
446
                        }
452
447
                        set { base.Description = value; }