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

Auto-complete <tab> feature does not see imported functions/objects #8581

Closed
scabug opened this issue May 12, 2014 · 7 comments
Closed

Auto-complete <tab> feature does not see imported functions/objects #8581

scabug opened this issue May 12, 2014 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 12, 2014

It seems some features were not correctly transferred between Scala versions 2.10.x and 2.11.0. In particular Auto-complete feature does not recognise functions or objects that were imported.

Example in 2.11.0:
scala> import Math.cos
import Math.cos
scala> co<tab>
com collection compat concurrent

While in 2.10.4 it was:
scala>import Math.cos
import Math.cos
scala> co<tab>
cos com collection compat concurrent

This feature is highly desired as it allows to quickly access method that were automatically imported. It also does not work for objects - this is very useful as it used to be possible to do this in 2.10.x:
CustomObject.<tab>
gives methods
This also does not work anymore. Hopefully these great features can be revived. Thank you!

@scabug
Copy link
Author

scabug commented May 12, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8581?orig=1
Reporter: Karolis Misiunas (k.misiunas-at-gmail.com)
Affected Versions: 2.11.0, 2.11.1, 2.11.2, 2.11.6

@scabug
Copy link
Author

scabug commented May 12, 2014

@som-snytt said:
Thanks for verifying that some features used to work.

Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object Foo { def foo = 1000 }
defined object Foo

scala> Foo.   // OK
asInstanceOf   foo   isInstanceOf   toString

scala> import Foo._
import Foo._

scala> foo    // OK
foo

scala> foo
res0: Int = 1000

scala> :pa -raw
// Entering paste mode (ctrl-D to finish)

package om { object Obj { def foodie = 42 }}

// Exiting paste mode, now interpreting.

scala> import om.Obj
import om.Obj

scala> foo
<console>:9: error: not found: value foo
              foo
              ^

scala> import math.cos  // OK
cos   cosh

scala> import math.cos
import math.cos

scala> co    // no cos
com   collection   compat   concurrent

scala> co    // double-tab
com   conforms   collection   compat   concurrent

scala> import concurrent._
import concurrent._

scala> Fut     // no Future at all
<console>:16: error: not found: value Fut
              Fut
              ^

@scabug
Copy link
Author

scabug commented Jun 13, 2014

Karolis Misiunas (k.misiunas-at-gmail.com) said:
Any hope that this will be fixed? Maybe I could help somehow?

@scabug
Copy link
Author

scabug commented Jun 19, 2015

@SethTisue said:
Perhaps this will get addressed in retronym's new effort to make tab completion use the presentation compiler. (Assigning to you Jason, but feel free to unassign.)

@scabug
Copy link
Author

scabug commented Apr 27, 2016

Kevin Kilroy (keki) said (edited on Apr 27, 2016 3:30:42 PM UTC):
Also, if you import a file using -i, then all tab completion is broken (on OSX scala 2.11.8).

i.e. test.scala:
import scala.math.BigDecimal._

scala -i test.scala

"".s // Nothing.

Note, importing the file using :load works OK.

@scabug
Copy link
Author

scabug commented Apr 27, 2016

@som-snytt said:
Init -i file is fixed under #7898

@scabug
Copy link
Author

scabug commented Apr 27, 2016

@som-snytt said:
Fixed as predicted by Seth. We forgot to complain that the results in 2.10 were not even sorted.

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