Skip to content

Commit

Permalink
chore: Update Scalameta to 4.8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Sep 26, 2023
1 parent 785d3f7 commit 45dece3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ trait Completions { this: MetalsGlobal =>
def inferStart(
pos: Position,
text: String,
charPred: Char => Boolean
charPred: Int => Boolean
): Int = {
def fallback: Int = {
var i = pos.point - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import scala.meta.internal.tokenizers.Chars._
*/
object ScaladocUtils {

/** Is character a whitespace character (but not a new line)? */
def isWhitespace(c: Char) =
c == ' ' || c == '\t' || c == CR

/**
* Returns index of string `str` following `start` skipping longest
* sequence of whitespace characters characters (but no newlines)
Expand Down Expand Up @@ -194,6 +198,10 @@ object ScaladocUtils {
else
str

/** Can character form part of a doc comment variable xxx? */
def isVarPart(c: Char) =
'0' <= c && c <= '9' || 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'

/**
* Returns index following variable, or start index if no variable was recognized
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class JavaToplevelMtags(val input: Input.VirtualFile) extends MtagsIndexer {
s"Unexpected symbol at word pos: '$ch'. Line: '$readCurrentLine'"
)
} else {
val pos = Position.Range(input, start, reader.charOffset)
val pos = Position.Range(input, start, reader.endCharOffset)
builder.mkString match {
case "package" => Token.Package
case "class" => Token.Class
Expand Down Expand Up @@ -133,13 +133,13 @@ class JavaToplevelMtags(val input: Input.VirtualFile) extends MtagsIndexer {
parseToken
case _ =>
val token = kwOrIdent(
reader.charOffset - 1,
reader.begCharOffset,
new StringBuilder().append(first).append(next)
)
(token, true)
}
case _ =>
val token = kwOrIdent(reader.charOffset, new StringBuilder(first))
val token = kwOrIdent(reader.endCharOffset, new StringBuilder(first))
(token, true)
}
}
Expand Down Expand Up @@ -205,7 +205,7 @@ class JavaToplevelMtags(val input: Input.VirtualFile) extends MtagsIndexer {

@tailrec
private def toNextNonWhiteSpace(): Unit = {
if (isWhitespace(reader.ch)) {
if (isWhitespace(reader.ch.toChar)) {
reader.nextChar()
toNextNonWhiteSpace()
}
Expand All @@ -224,7 +224,7 @@ class JavaToplevelMtags(val input: Input.VirtualFile) extends MtagsIndexer {
}

val lineOffset = reader.lineStartOffset
val existing = input.text.substring(lineOffset, reader.charOffset)
val existing = input.text.substring(lineOffset, reader.endCharOffset)
loop(new StringBuilder().append(existing))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class ScalaToplevelMtags(
case WHITESPACE =>
nextIsNL()
case COMMENT =>
scanner.skipComment()
scanner.nextToken()
nextIsNL()
case _ => false
}
Expand Down
2 changes: 1 addition & 1 deletion project/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object V {
val scalaCli = "1.0.4"
val scalafix = "0.11.1"
val scalafmt = "3.7.14"
val scalameta = "4.8.10"
val scalameta = "4.8.11"
val scribe = "3.12.2"
val qdox = "2.0.3"

Expand Down

0 comments on commit 45dece3

Please sign in to comment.