scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.07k stars 321 forks source link

Code Autosuggest/Autocomplete Issues #3622

Open LingarajVB opened 2 years ago

LingarajVB commented 2 years ago

Describe the bug

Autocomplete failed in the following case

I was trying to convert Array[String] to Seq[Row] (note: Row comes from "import org.apache.spark.sql.Row") i.e., Array("dir1/","dir2") to Seq(Row("dir1/"),Row("dir2/")) by making a slight modification to existing String literals in the Array (as shown below)

image

My code compiles fine and runs fine but autocomplete for "concat" method did not work. (as shown below)

image

PS: Love Metals 👍

Expected behavior

It should have shown following suggestions (concat method) which it failed to show. (as shown below)

image

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.12.0

Scala Version

v2.11.12

Extra context or search terms

autocomplete with apache spark issues | autocomplete issues inside Row in apache spark | nested autosuggestion issues

tgodzik commented 2 years ago

Thanks for reporting! Which Scala version are you using?

LingarajVB commented 2 years ago

@tgodzik Scala 2.11.12 (updated my prev comment with same)

dos65 commented 2 years ago

@LingarajVB which jvm version do you use? I've seen that completions doesn't work with scala2.11 + jvm > 8

tgodzik commented 2 years ago

IT seems I can reproduce it with:

  case class Location(city: String)
  val list = List("")
  list.map(str => Location(str.stripMargin.con@@("")))

but sometimes it work and sometimes it doesn't :O

dos65 commented 2 years ago

@tgodzik could you check .metals/metals.log? Probably there will be errors from PC

tgodzik commented 2 years ago

There is nothing :D Quite a mistery this is.

LingarajVB commented 2 years ago

@dos65 jdk1.8 home/jre