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); }
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()); }
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)); }
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) { }
public override void StartParameters(Cci.SourceContext context) { this.vsAuthoringSink.StartParameters(new SourceContext(context)); }
public override void NextParameter(Cci.SourceContext context) { this.vsAuthoringSink.NextParameter(new SourceContext(context)); }
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)); }
public override void MatchPair(Cci.SourceContext startContext, Cci.SourceContext endContext) { this.vsAuthoringSink.MatchPair(new SourceContext(startContext), new SourceContext(endContext)); }
public override void CodeSpan(Cci.SourceContext spanContext) { this.vsAuthoringSink.CodeSpan(new SourceContext(spanContext)); }
public override void AutoExpression(Cci.SourceContext exprContext) { this.vsAuthoringSink.AutoExpression(new SourceContext(exprContext)); }
public CollapsibleRegion(Cci.SourceContext sourceContext, bool collapsed) { this.SourceContext = sourceContext; this.Collapsed = collapsed; }