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

Sbt autocomplete interacts poorly with windows #1873

Open
Katrix opened this issue Sep 27, 2023 · 1 comment
Open

Sbt autocomplete interacts poorly with windows #1873

Katrix opened this issue Sep 27, 2023 · 1 comment

Comments

@Katrix
Copy link

Katrix commented Sep 27, 2023

Trying to autocomplete scalafixAll --files=coreShared, when a folder exists called coreShared produces an exception. Filling out the next part manually (coreShared\\src) does not autocomplete at all

sep. 27, 2023 10:51:50 A.M. org.jline.utils.Log logr
INFO: Error while finding completion candidates
java.nio.file.InvalidPathException: Trailing char < > at index 10: coreShared
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
        at java.base/java.nio.file.Path.of(Path.java:147)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at scalafix.internal.sbt.ScalafixCompletions$AbsolutePathCompleter$1$.mkBase(ScalafixCompletions.scala:58)
        at scalafix.internal.sbt.ScalafixCompletions$AbsolutePathExamples$1.withAddedPrefix(ScalafixCompletions.scala:52)
        at scalafix.internal.sbt.ScalafixCompletions$AbsolutePathExamples$1.withAddedPrefix(ScalafixCompletions.scala:45)
        at sbt.internal.util.complete.ParserWithExamples.derive(Parser.scala:870)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.Filter.derive(Parser.scala:783)
        at sbt.internal.util.complete.TokenStart.derive(Parser.scala:810)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.OnFailure.derive(Parser.scala:683)
        at sbt.internal.util.complete.HomParser.derive(Parser.scala:707)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.Repeat.derive(Parser.scala:945)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.ParserSeq.$anonfun$derive$3(Parser.scala:738)
        at scala.collection.immutable.List.map(List.scala:293)
        at sbt.internal.util.complete.ParserSeq.derive(Parser.scala:738)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.MatchedString.derive(Parser.scala:796)
        at sbt.internal.util.complete.And.derive(Parser.scala:826)
        at sbt.internal.util.complete.HomParser.derive(Parser.scala:707)
        at sbt.internal.util.complete.MapParser.derive(Parser.scala:771)
        at sbt.internal.util.complete.And.derive(Parser.scala:826)
        at sbt.internal.util.complete.SeqParser.derive(Parser.scala:694)
        at sbt.internal.util.complete.ParserMain.derive1(Parser.scala:497)
        at sbt.internal.util.complete.ParserMain.derive1$(Parser.scala:496)
        at sbt.internal.util.complete.Parser$.derive1(Parser.scala:139)
        at sbt.internal.util.complete.ParserMain.$anonfun$apply$1(Parser.scala:493)
        at sbt.internal.util.complete.ParserMain.$anonfun$apply$1$adapted(Parser.scala:493)
        at scala.collection.IndexedSeqOptimized.foldLeft(IndexedSeqOptimized.scala:60)
        at scala.collection.IndexedSeqOptimized.foldLeft$(IndexedSeqOptimized.scala:68)
        at scala.collection.immutable.StringOps.foldLeft(StringOps.scala:33)
        at sbt.internal.util.complete.ParserMain.apply(Parser.scala:493)
        at sbt.internal.util.complete.ParserMain.apply$(Parser.scala:492)
        at sbt.internal.util.complete.Parser$.apply(Parser.scala:139)
        at sbt.internal.util.complete.BindParser.$anonfun$completions$3(Parser.scala:749)
        at sbt.internal.util.complete.Completions.$anonfun$flatMap$2(Completions.scala:29)
        at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
        at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:335)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:1111)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:1111)
        at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:1111)
        at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
        at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
        at sbt.internal.util.complete.Completions.$anonfun$flatMap$1(Completions.scala:29)
        at sbt.internal.util.complete.Completions$$anon$1.get$lzycompute(Completions.scala:43)
        at sbt.internal.util.complete.Completions$$anon$1.get(Completions.scala:43)
        at sbt.internal.util.complete.Completions.$anonfun$$plus$plus$1(Completions.scala:21)
        at sbt.internal.util.complete.Completions$$anon$1.get$lzycompute(Completions.scala:43)
        at sbt.internal.util.complete.Completions$$anon$1.get(Completions.scala:43)
        at sbt.internal.util.complete.Completions.$anonfun$flatMap$1(Completions.scala:29)
        at sbt.internal.util.complete.Completions$$anon$1.get$lzycompute(Completions.scala:43)
        at sbt.internal.util.complete.Completions$$anon$1.get(Completions.scala:43)
        at sbt.internal.util.LineReader$$anon$1.complete(LineReader.scala:49)
        at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4412)
        at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4378)
        at org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4317)
        at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3809)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:679)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468)
        at sbt.internal.util.LineReader$$anon$2.$anonfun$readLine$6(LineReader.scala:130)
        at scala.Option.getOrElse(Option.scala:189)
        at sbt.internal.util.LineReader$$anon$2.$anonfun$readLine$4(LineReader.scala:130)
        at sbt.internal.util.Terminal.withRawInput(Terminal.scala:146)
        at sbt.internal.util.Terminal.withRawInput$(Terminal.scala:144)
        at sbt.internal.util.Terminal$TerminalImpl.withRawInput(Terminal.scala:948)
        at sbt.internal.util.LineReader$$anon$2.readLine(LineReader.scala:130)
        at sbt.internal.ui.UITask$Reader$$anon$1.readLine(UITask.scala:71)
        at sbt.internal.ui.UITask.impl$1(UITask.scala:35)
        at sbt.internal.ui.UITask.run(UITask.scala:38)
        at sbt.internal.ui.UITask.run$(UITask.scala:33)
        at sbt.internal.ui.UITask$AskUserTask.run(UITask.scala:110)
        at sbt.internal.ui.UserThread$$anon$1.run(UserThread.scala:39)
@bjaglin
Copy link
Collaborator

bjaglin commented Nov 6, 2023

Thanks for the report!

Support for autocomplete is not tested on Windows... It seems that there has been some previous discussions, but no follow up on that specific topic.

I do not own a Windows machine, so debugging this might me hard through the CI. Is there any chance you could try to run the SkipWindows-tagged test from sbt-scalafix locally and get a hint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants