diff options
author | Luc Bourlier <luc.bourlier@typesafe.com> | 2013-11-13 17:24:59 +0100 |
---|---|---|
committer | Luc Bourlier <luc.bourlier@typesafe.com> | 2013-11-21 12:24:48 +0100 |
commit | 053a2744c6dfa339e004fbdab8994dc435e60b45 (patch) | |
tree | 39f5f9e600cc1686611d9b0ded067183ec05bed2 /test/files/presentation/scope-completion-import/src | |
parent | eb9f0f797535386d44f9bc1f9e0c1765622baa29 (diff) | |
download | scala-053a2744c6dfa339e004fbdab8994dc435e60b45.tar.gz scala-053a2744c6dfa339e004fbdab8994dc435e60b45.tar.bz2 scala-053a2744c6dfa339e004fbdab8994dc435e60b45.zip |
[nomaster] SI-7280 Scope completion not returning members provided by imports
Updates localeContext() to return the best context possible when there are none directly
associated with the given position. It happens when an expression cannot be
successfully typed, as no precise ContextTree covers the expression location, or if the
position is not inside any expression.
Adds corresponding tests
(cherry picked from commit 3028327e2a2b553b12ee45519413515c8aa0865f)
Diffstat (limited to 'test/files/presentation/scope-completion-import/src')
-rw-r--r-- | test/files/presentation/scope-completion-import/src/Completions.scala | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/files/presentation/scope-completion-import/src/Completions.scala b/test/files/presentation/scope-completion-import/src/Completions.scala new file mode 100644 index 0000000000..6e08321283 --- /dev/null +++ b/test/files/presentation/scope-completion-import/src/Completions.scala @@ -0,0 +1,64 @@ +package test + +class C { + def fCCC : Int = 0 +} + +object O extends C { + def fOOO : Int = 0 +} + +class Foo { + { + val o = O + import o._ + /*_*/ + } + { + import O._ + /*_*/ + } + { + val c = new C + import c._ + /*_*/ + } + { + f/*_*/ + val c = new C + import c._ + f/*_*/ + import O._ + f/*_*/ + } +} + +class Foo_1 { + + import O._ + + def bar { + /*_*/ + } +} + +class Foo_2 { + + val o = O + import o._ + + def bar { + /*_*/ + } +} + +class Foo_3 { + + val c = new C + import c._ + + def bar { + /*_*/ + } +} + |