Skip to content

Commit 983cc64

Browse files
committed
Skip exclusions completely instead of adding them temporarily
...to the source path. The rationale for this is that language features would be provided even for excluded files, e.g. .kts scripts when `kotlin.scripts.enabled` is disabled or source files in auto-generated directories such as `./bin`.
1 parent 5b44456 commit 983cc64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/main/kotlin/org/javacs/kt/SourceFiles.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ class SourceFiles(
7474
private val open = mutableSetOf<URI>()
7575

7676
fun open(uri: URI, content: String, version: Int) {
77-
files[uri] = SourceVersion(content, version, languageOf(uri), isTemporary = !exclusions.isURIIncluded(uri))
78-
open.add(uri)
77+
if (exclusions.isURIIncluded(uri)) {
78+
files[uri] = SourceVersion(content, version, languageOf(uri), isTemporary = false)
79+
open.add(uri)
80+
}
7981
}
8082

8183
fun close(uri: URI) {

0 commit comments

Comments
 (0)