Closed
Description
Minimized code
In Metals we are reusing the Dotty language server code in the form of:
val uri = params.uri
val sourceFile = CompilerInterfaces.toSource(params.uri, params.text)
driver.run(uri, sourceFile)
given ctx as Context = driver.currentCtx
val pos = sourcePosition(driver, params, uri)
val items = driver.compilationUnits.get(uri) match {
case Some(unit) =>
Completion.completions(pos)(using ctx.fresh.setCompilationUnit(unit))._2
case None => Nil
}
Currently though when trying to complete for example:
object A
prin
we are not getting any completions. This regressed in 0.27.0-RC1.
Expected would for example print
or println
. This seems to have happened to anything that is not in a local scope.