Skip to content

Commit

Permalink
method to get all tokens at a position
Browse files Browse the repository at this point in the history
  • Loading branch information
harrah committed Apr 8, 2013
1 parent e34d2b3 commit c533cb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/Browse.scala
Expand Up @@ -132,10 +132,13 @@ abstract class Browse extends Plugin
}
/** Gets the token for the given offset.*/
private def tokenAt(tokens: wrap.SortedSetWrapper[Token], offset: Int): Option[Token] =
tokensAt(tokens, offset).headOption
/** Gets the token for the given offset.*/
private def tokensAt(tokens: wrap.SortedSetWrapper[Token], offset: Int): List[Token] =
{
// create artificial tokens to get a subset of the tokens starting at the given offset
// then, take the first token in the range
tokens.range(new Token(offset, 1, 0), new Token(offset+1, 1, 0)).first
tokens.range(new Token(offset, 1, 0), new Token(offset+1, 1, 0)).toList
}

/** Filters unwanted symbols, such as packages.*/
Expand Down

0 comments on commit c533cb0

Please sign in to comment.