All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tools.SemanticToken.scala Maven / Gradle / Ivy

There is a newer version: 0.0.22
Show newest version
package langoustine
package lsp
package tools

import langoustine.lsp.structures.Position
import scala.collection.SortedMap
import langoustine.lsp.structures.SemanticTokensLegend

case class SemanticToken(
    position: Position,
    length: lsp.runtime.uinteger,
    tokenType: enumerations.SemanticTokenTypes,
    modifiers: Vector[enumerations.SemanticTokenModifiers] = Vector.empty
)

object SemanticToken:
  def fromRange(
      range: lsp.structures.Range,
      tokenType: enumerations.SemanticTokenTypes,
      modifiers: Vector[enumerations.SemanticTokenModifiers] = Vector.empty
  ) =
    SemanticToken(
      position = range.start,
      length = range.end.character.map(_ - range.start.character.value),
      tokenType = tokenType,
      modifiers = modifiers
    )
end SemanticToken




© 2015 - 2024 Weber Informatics LLC | Privacy Policy