Skip to content

Commit 359e26c

Browse files
authored
use is available
1 parent 580e237 commit 359e26c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/com/emberjs/glint/GlintLanguageService.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ import java.util.concurrent.Future
5252
import java.util.stream.Stream
5353

5454
class GlintLanguageServiceProvider(val project: Project) : JSLanguageServiceProvider {
55+
val descriptor = getGlintDescriptor(project)
5556

5657
override fun isHighlightingCandidate(file: VirtualFile) = file.fileType is HbFileType || file.fileType is JavaScriptFileType || file.fileType is TypeScriptFileType || file.fileType is GtsFileType
5758

58-
override fun getService(file: VirtualFile) = allServices.firstOrNull()
59+
override fun getService(file: VirtualFile) = if (descriptor.isAvailable(file)) return GlintTypeScriptService.getInstance(project) else null
5960

6061
override val allServices: List<GlintTypeScriptService>
61-
get() = if (EmberUtils.isEnabledEmberProject(project)) listOf(GlintTypeScriptService.getInstance(project)) else emptyList()
62+
get() = if (descriptor.isAvailable()) listOf(GlintTypeScriptService.getInstance(project)) else emptyList()
6263
}
6364

6465

0 commit comments

Comments
 (0)