Skip to content

Commit

Permalink
LaguageSupport: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mchakravarty committed May 26, 2023
1 parent dc15542 commit 4e4e519
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/LanguageSupport/LanguageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public protocol LanguageService {
/// - Returns: Semantic tokens together with their line-relative character range divided up per line. The first
/// subarray contains the semantic tokens for the first line of `lineRange` and so on.
///
/// The number of elements of the result is the same as the number of lines in the `lineRange`.
///
func tokens(for lineRange: Range<Int>) async throws -> [[(token: LanguageConfiguration.Token, range: NSRange)]]

/// Yields an info popover for the given location in the file associated with the current language service.
Expand Down
5 changes: 5 additions & 0 deletions Sources/LanguageSupport/Tokeniser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public struct Tokeniser<TokenType: Equatable, StateType: TokeniserState> {
///
public var range: NSRange

public init(token: TokenType, range: NSRange) {
self.token = token
self.range = range
}

/// Produce a copy with an adjusted location of the token by shifting it by the given amount.
///
/// - Parameter amount: The amount by which to shift the token. (Positive amounts shift to the right and negative
Expand Down

0 comments on commit 4e4e519

Please sign in to comment.