Skip to content

Commit 2854fe4

Browse files
committed
remove maybeIncomplete from SourceFile
1 parent b2850be commit 2854fe4

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

compiler/src/dotty/tools/dotc/CompilationUnit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ object CompilationUnit {
162162
* Used for `compiletime.testing.typeChecks`.
163163
*/
164164
def apply(name: String, source: String): CompilationUnit = {
165-
val src = SourceFile.virtual(name = name, content = source, maybeIncomplete = false)
165+
val src = SourceFile.virtual(name = name, content = source)
166166
new CompilationUnit(src, null)
167167
}
168168

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,8 @@ object Scanners {
784784
if lastToken == IDENTIFIER && lastName != null && isIdentifierStart(lastName.head)
785785
|| colonEOLPredecessors.contains(lastToken)
786786
then token = COLONfollow
787-
case RBRACE | RPAREN | RBRACKET =>
787+
case RBRACE | RPAREN | RBRACKET | EOF =>
788788
closeIndented()
789-
case EOF =>
790-
if !source.maybeIncomplete then closeIndented()
791789
case _ =>
792790
}
793791
}

compiler/src/dotty/tools/dotc/util/SourceFile.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends
104104
myContent
105105
}
106106

107-
private var _maybeInComplete: Boolean = false
108-
109-
def maybeIncomplete: Boolean = _maybeInComplete
110-
111107
override def name: String = file.name
112108
override def path: String = file.path
113109
override def jfile: Optional[JFile] = Optional.ofNullable(file.file)
@@ -252,9 +248,8 @@ object SourceFile {
252248
/** A source file with an underlying virtual file. The name is taken as a file system path
253249
* with the local separator converted to "/". The last element of the path will be the simple name of the file.
254250
*/
255-
def virtual(name: String, content: String, maybeIncomplete: Boolean = false) =
251+
def virtual(name: String, content: String) =
256252
SourceFile(new VirtualFile(name.replace(separator, "/"), content.getBytes(StandardCharsets.UTF_8)), content.toCharArray)
257-
.tap(_._maybeInComplete = maybeIncomplete)
258253

259254
/** A helper method to create a virtual source file for given URI.
260255
* It relies on SourceFile#virtual implementation to create the virtual file.

0 commit comments

Comments
 (0)