Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR issues while parsing: UnexpectedInputEndException #6717

Closed
susliko opened this issue Aug 25, 2024 · 1 comment · Fixed by #6726
Closed

ERROR issues while parsing: UnexpectedInputEndException #6717

susliko opened this issue Aug 25, 2024 · 1 comment · Fixed by #6726
Labels
bug Something that is making a piece of functionality unusable tokenizer
Milestone

Comments

@susliko
Copy link
Contributor

susliko commented Aug 25, 2024

Describe the bug

  1. Create file doobie.scala
//> using scala 2.13
//> using dep org.tpolecat::doobie-free::1.0.0-RC5

import doobie.free._

trait X
  1. Execute scala-cli setup-ide doobie.scala
  2. Open file with any editor, import the build
  3. Open logs:
2024.08.25 21:04:03 ERROR issues while parsing: /home/susliko/.cache/coursier/v1/https/repo1.maven.org/maven2/org/tpolecat/doobie-free_2.13/1.0.0-RC5/doobie-free_2.13-1.0.0-RC5-sources.jar
scala.meta.internal.tokenizers.package$UnexpectedInputEndException
        at scala.meta.internal.tokenizers.LegacyScanner.$anonfun$nextToken$1(LegacyScanner.scala:172)
        at scala.Function0.apply$mcV$sp(Function0.scala:42)
        at scala.meta.internal.tokenizers.LegacyScanner.scala$meta$internal$tokenizers$LegacyScanner$$nextToken(LegacyScanner.scala:178)
        at scala.meta.internal.tokenizers.LegacyScanner.nextToken(LegacyScanner.scala:172)
        at scala.meta.internal.mtags.ScalaToplevelMtags$XtensionScanner.mtagsNextToken(ScalaToplevelMtags.scala:72)
        at scala.meta.internal.mtags.ScalaToplevelMtags.loop(ScalaToplevelMtags.scala:481)
        at scala.meta.internal.mtags.ScalaToplevelMtags.indexRoot(ScalaToplevelMtags.scala:84)
        at scala.meta.internal.mtags.MtagsIndexer.index(MtagsIndexer.scala:21)
        at scala.meta.internal.mtags.MtagsIndexer.index$(MtagsIndexer.scala:20)
        at scala.meta.internal.mtags.ScalaToplevelMtags.index(ScalaToplevelMtags.scala:44)
        at scala.meta.internal.mtags.Mtags.indexWithOverrides(Mtags.scala:74)
        at scala.meta.internal.mtags.SymbolIndexBucket.indexSource(SymbolIndexBucket.scala:124)
        at scala.meta.internal.mtags.SymbolIndexBucket.addSourceFile(SymbolIndexBucket.scala:107)
        at scala.meta.internal.mtags.SymbolIndexBucket.$anonfun$addSourceJar$2(SymbolIndexBucket.scala:71)
...

Expected behavior

No exceptions while indexing dependency jars

Operating system

Linux

Editor/Extension

Nvim (nvim-metals)

Version of Metals

v1.3.5

Extra context or search terms

No response

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable tokenizer labels Aug 26, 2024
tgodzik added a commit to tgodzik/metals that referenced this issue Aug 27, 2024
One file failing to tokenize should not cause the entire jar to not be tokenized.

This was prompted by /doobie/free/kleisliinterpreter.scala which was ended in the middle inside the sources.

Fixes scalameta#6717
@tgodzik
Copy link
Contributor

tgodzik commented Aug 27, 2024

Thanks for reporting! This actually a valid exception since that file ends in the middle, the source is broken. I added an improvement to handle single broken file like that

tgodzik added a commit that referenced this issue Sep 3, 2024
One file failing to tokenize should not cause the entire jar to not be tokenized.

This was prompted by /doobie/free/kleisliinterpreter.scala which was ended in the middle inside the sources.

Fixes #6717
@tgodzik tgodzik added this to the Metals v1.4.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable tokenizer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants