Skip to content

Commit

Permalink
Skip exclusions completely instead of adding them temporarily
Browse files Browse the repository at this point in the history
...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`.
  • Loading branch information
fwcd committed Jan 15, 2024
1 parent 5b44456 commit 983cc64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src/main/kotlin/org/javacs/kt/SourceFiles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ class SourceFiles(
private val open = mutableSetOf<URI>()

fun open(uri: URI, content: String, version: Int) {
files[uri] = SourceVersion(content, version, languageOf(uri), isTemporary = !exclusions.isURIIncluded(uri))
open.add(uri)
if (exclusions.isURIIncluded(uri)) {
files[uri] = SourceVersion(content, version, languageOf(uri), isTemporary = false)
open.add(uri)
}
}

fun close(uri: URI) {
Expand Down

0 comments on commit 983cc64

Please sign in to comment.