Longest Substring Without Repeating Characters in Scala
Some observations while looking over the code:


if (s.isEmpty) 0 - This isn't necessary. The code produces the correct results without this test. Removing it would reduce the level of indenting for the rest of the code.
if (!(lookupTable contains c)) - Dijkstra suggests that it is usually better to test for the positive condition, especially when there is an else block. It's often much easier to read and parse that way. In this case the else condition is "NOT table has c == false". (Ouch!)
val newLength - You actually don't need this variable. Try:length = length max i - start
lookupTable(c) = i - This assignment is made on both sides of the if test, which means it really doesn't belong there.

if (lookupTable contains c) {
  length = length max i - start
  start = lookupTable(c) + 1
  lookupTable.retain((k,v) =&gt; v &gt;= start)
}
lookupTable(c) = i



But, of course, the most noteworthy is the use of mutable variables and data structures. Sometimes we have to fall back on imperative programming if functional means/methods are creating a bottleneck, but, short of that, the point of learning/using Scala is its Functional Programming capability.

Here's a reworking of the same algorithm using two index values to access a static array of characters. Each index is advanced via tail-recursive methods so everything remains immutable.

def lengthOfMaxSubstring(s: String): Int = {
  val chars: Array[Char] = s.toArray

  def headForward(leadx: Int, rearx: Int, cSet: Set[Char], best: Int): Int = {

    def tailForward(tlx: Int, cs: Set[Char]): (Int, Set[Char]) =
      if (chars(tlx) == chars(leadx)) (tlx + 1, cs)
      else tailForward(tlx + 1, cs - chars(tlx))

    if (leadx &gt;= chars.length) best max leadx-rearx
    else if (cSet(chars(leadx))) {
      val (newTail, newSet) = tailForward(rearx, cSet)
      headForward(leadx+1, newTail, newSet, best max leadx-rearx)
    } else
      headForward(leadx+1, rearx, cSet + chars(leadx), best)
  }
  headForward(0, 0, Set(), 0)
}