예제 #1
0
        int GetMethodHeaderEndColumn()
        {
            CommonTree arguments = methodDefinition.GetFirstChildArguments();

            if (arguments != null)
            {
                IToken token = ast.GetToken(arguments.TokenStopIndex);
                return(token.EndColumn());
            }
            return(0);
        }
예제 #2
0
        int GetMethodBodyEndColumn()
        {
            IToken token = GetFunctionDefinitionEndToken();

            return(token.EndColumn());
        }
예제 #3
0
 /// <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()));
 }