Exemple #1
0
        public override string Goto(VsCommands cmd, IVsTextView textView, int line, int col, out TextSpan span)
        {
            span = new TextSpan();
            Cci.SourceContext targetPosition = new Cci.SourceContext();
            switch (cmd)
            {
            case VsCommands.GotoDecl:
                targetPosition = this.scAuthoringScope.GetPositionOfDeclaration(line, col);
                break;

            case VsCommands.GotoDefn:
                targetPosition = this.scAuthoringScope.GetPositionOfDefinition(line, col);
                break;

            case VsCommands.GotoRef:
                targetPosition = this.scAuthoringScope.GetPositionOfReference(line, col);
                break;
            }
            if (targetPosition.Document != null)
            {
                span.iEndIndex   = targetPosition.EndColumn - 1;
                span.iEndLine    = targetPosition.EndLine - 1;
                span.iStartIndex = targetPosition.StartColumn - 1;
                span.iStartLine  = targetPosition.StartLine - 1;
                return(targetPosition.Document.Name);
            }
            else
            {
                //TODO: return URL to object browser for imported type information.
            }
            return(null);
        }
Exemple #2
0
 public override void QualifyName(Cci.SourceContext selectorContext, Cci.Expression name)
 {
     if (name == null)
     {
         return;
     }
     this.vsAuthoringSink.QualifyName(new SourceContext(selectorContext), new SourceContext(name.SourceContext), name.ToString());
 }
Exemple #3
0
 public override void AddCollapsibleRegion(Cci.SourceContext context, bool collapsed)
 {
     if (this.CollapsibleRegions == null)
     {
         this.CollapsibleRegions = new ArrayList();
     }
     this.CollapsibleRegions.Add(new CollapsibleRegion(context, collapsed));
 }
 public static Location ToLocation(this CCI.SourceContext ctx)
 {
     return(new Location
                (ctx.Document.Name,
                ctx.StartPos,
                ctx.StartLine,
                ctx.StartColumn,
                ctx.EndPos,
                ctx.EndLine,
                ctx.EndColumn));
 }
Exemple #5
0
 public SourceContext(Cci.SourceContext scContext)
     : base(scContext.StartLine - 1, scContext.StartColumn - 1, scContext.EndLine - 1, scContext.EndColumn - 1,
            scContext.Document == null ? null : scContext.Document.Name)
 {
 }
Exemple #6
0
 public override void StartParameters(Cci.SourceContext context)
 {
     this.vsAuthoringSink.StartParameters(new SourceContext(context));
 }
Exemple #7
0
 public override void NextParameter(Cci.SourceContext context)
 {
     this.vsAuthoringSink.NextParameter(new SourceContext(context));
 }
Exemple #8
0
 public override void MatchTriple(Cci.SourceContext startContext, Cci.SourceContext middleContext, Cci.SourceContext endContext)
 {
     this.vsAuthoringSink.MatchTriple(new SourceContext(startContext), new SourceContext(middleContext), new SourceContext(endContext));
 }
Exemple #9
0
 public override void MatchPair(Cci.SourceContext startContext, Cci.SourceContext endContext)
 {
     this.vsAuthoringSink.MatchPair(new SourceContext(startContext), new SourceContext(endContext));
 }
Exemple #10
0
 public override void CodeSpan(Cci.SourceContext spanContext)
 {
     this.vsAuthoringSink.CodeSpan(new SourceContext(spanContext));
 }
Exemple #11
0
 public override void AutoExpression(Cci.SourceContext exprContext)
 {
     this.vsAuthoringSink.AutoExpression(new SourceContext(exprContext));
 }
Exemple #12
0
 public CollapsibleRegion(Cci.SourceContext sourceContext, bool collapsed)
 {
     this.SourceContext = sourceContext;
     this.Collapsed     = collapsed;
 }