summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-11-29 11:19:41 +0100
committerGitHub <noreply@github.com>2016-11-29 11:19:41 +0100
commitb02e3914b6dee6b7da1c3da1864343ccdce5ca3c (patch)
treefad9cb4f05be35ac5bd214bcc4b8418eb27c6b09
parent2bc92e0b2fa9f6de2b2a6c8f9ef4b85492e7df4d (diff)
parent4fba067fc845551041b8f32b82268ecdd5d6f757 (diff)
downloadscala-b02e3914b6dee6b7da1c3da1864343ccdce5ca3c.tar.gz
scala-b02e3914b6dee6b7da1c3da1864343ccdce5ca3c.tar.bz2
scala-b02e3914b6dee6b7da1c3da1864343ccdce5ca3c.zip
Merge pull request #5561 from retronym/topic/merge-2.11.x-to-2.12.x-20161129
Merge 2.11.x to 2.12.x [ci: last-only]
-rwxr-xr-xscripts/jobs/integrate/bootstrap2
-rw-r--r--spec/_layouts/default.yml4
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala3
-rw-r--r--test/junit/scala/tools/nsc/interpreter/CompletionTest.scala8
4 files changed, 13 insertions, 4 deletions
diff --git a/scripts/jobs/integrate/bootstrap b/scripts/jobs/integrate/bootstrap
index ed1e05251a..7c045ae918 100755
--- a/scripts/jobs/integrate/bootstrap
+++ b/scripts/jobs/integrate/bootstrap
@@ -430,7 +430,7 @@ removeExistingBuilds() {
local scalaLangModules=`curl -s $storageApiUrl/org/scala-lang | jq -r '.children | .[] | "org/scala-lang" + .uri' | grep -v actors-migration`
for module in $scalaLangModules; do
- local artifacts=`curl -s $storageApiUrl/$module | jq -r ".children | .[] | select(.uri | contains(\"$SCALA_VER\")) | .uri"`
+ local artifacts=`curl -s $storageApiUrl/$module | jq -r ".children | .[] | select(.uri | endswith(\"$SCALA_VER\")) | .uri"`
for artifact in $artifacts; do
echo "Deleting $releaseTempRepoUrl$module$artifact"
curl -s --netrc-file $netrcFile -X DELETE $releaseTempRepoUrl$module$artifact
diff --git a/spec/_layouts/default.yml b/spec/_layouts/default.yml
index 06d8c1c118..983d4e56ae 100644
--- a/spec/_layouts/default.yml
+++ b/spec/_layouts/default.yml
@@ -15,9 +15,9 @@
}
});
</script>
- <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+ <script type="text/javascript" src="//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css">
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css">
<!-- need to use include to see value of page.chapter variable -->
<style type="text/css">
{% include numbering.css %}
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 715ba0d4f3..669a018f10 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -1189,7 +1189,8 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
case Nil => entered.isEmpty && matchCount > 0
case head :: tail =>
val enteredAlternatives = Set(entered, entered.capitalize)
- head.inits.filter(_.length <= entered.length).exists(init =>
+ val n = (head, entered).zipped.count {case (c, e) => c == e || (c.isUpper && c == e.toUpper)}
+ head.take(n).inits.exists(init =>
enteredAlternatives.exists(entered =>
lenientMatch(entered.stripPrefix(init), tail, matchCount + (if (init.isEmpty) 0 else 1))
)
diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
index 1233e8b1cc..a216b319a8 100644
--- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
+++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
@@ -185,6 +185,14 @@ class CompletionTest {
checkExact(completer, "p1.p2.p3.Ping.Po")("Pong")
}
+ @Test
+ def performanceOfLenientMatch(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ val ident: String = "thisIsAReallyLongMethodNameWithManyManyManyManyChunks"
+ checkExact(completer, s"($ident: Int) => tia")(ident)
+ }
+
def checkExact(completer: PresentationCompilerCompleter, before: String, after: String = "")(expected: String*): Unit = {
assertEquals(expected.toSet, completer.complete(before, after).candidates.toSet)
}