diff options
author | Miles Sabin <miles@milessabin.com> | 2009-05-31 19:58:48 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-05-31 19:58:48 +0000 |
commit | fb57f8cec1dbde695e94a819e998f80f6d875dad (patch) | |
tree | c0fb5558ee114259f08b3b4086151cd2691e52b8 /src/compiler | |
parent | 8c23908ebb28540e89d3eec8ef699d6af55c3d55 (diff) | |
download | scala-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.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/util/SourceFile.scala | 10 |
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 |