int GetMethodHeaderEndColumn() { CommonTree arguments = methodDefinition.GetFirstChildArguments(); if (arguments != null) { IToken token = ast.GetToken(arguments.TokenStopIndex); return(token.EndColumn()); } return(0); }
int GetMethodBodyEndColumn() { IToken token = GetFunctionDefinitionEndToken(); return(token.EndColumn()); }
/// <summary> /// Validates whether a token is contained within a given Selection /// </summary> /// <param name="selection">One-based selection, usually from CodePane.Selection</param> /// <param name="token">An individual token within a module's parse tree</param> /// <returns>Boolean with true indicating that token is within the selection</returns> public static bool Contains(this Selection selection, IToken token) { return (((selection.StartLine == token.Line) && (selection.StartColumn - 1) <= token.Column) || (selection.StartLine < token.Line)) && (((selection.EndLine == token.EndLine()) && (selection.EndColumn - 1) >= (token.EndColumn())) || (selection.EndLine > token.EndLine())); }