summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-05-31 19:58:48 +0000
committerMiles Sabin <miles@milessabin.com>2009-05-31 19:58:48 +0000
commitfb57f8cec1dbde695e94a819e998f80f6d875dad (patch)
treec0fb5558ee114259f08b3b4086151cd2691e52b8
parent8c23908ebb28540e89d3eec8ef699d6af55c3d55 (diff)
downloadscala-fb57f8cec1dbde695e94a819e998f80f6d875dad.tar.gz
scala-fb57f8cec1dbde695e94a819e998f80f6d875dad.tar.bz2
scala-fb57f8cec1dbde695e94a819e998f80f6d875dad.zip
Allow the content of SourceFiles backed by inte...
Allow the content of SourceFiles backed by interactive buffers to be updated.
-rw-r--r--src/compiler/scala/tools/nsc/util/SourceFile.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala
index 9f5e094472..6d783e36b3 100644
--- a/src/compiler/scala/tools/nsc/util/SourceFile.scala
+++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala
@@ -66,8 +66,14 @@ class BatchSourceFile(val file : AbstractFile, _content : Array[Char]) extends S
}
override def hashCode = file.hashCode
- val content = _content
- override val length = content.length
+ var content = _content
+ var length = _content.length
+
+ def setContent(newContent : Array[Char]) {
+ content = newContent
+ length = newContent.length
+ }
+
// in SourceFileFragments, these are overridden to compensate during offset calculation
// Invariant: length + start = underlyingLength
def underlyingLength = length